dbi-dbrc 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.1.6 - 10-Sep-2009
2
+ * Fixed validation for dbrc_dir argument.
3
+ * Added a test for bogus dbrc_dir arguments.
4
+
1
5
  == 1.1.5 - 3-Sep-2009
2
6
  * License changed to Artistic 2.0.
3
7
  * Some gemspec updates, including the license and description.
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |s|
4
4
  s.name = 'dbi-dbrc'
5
- s.version = '1.1.5'
5
+ s.version = '1.1.6'
6
6
  s.author = 'Daniel Berger'
7
7
  s.email = 'djberg96@gmail.com'
8
8
  s.license = 'Artistic 2.0'
@@ -18,7 +18,7 @@ module DBI
18
18
  class Error < StandardError; end
19
19
 
20
20
  # The version of the dbi-dbrc library
21
- VERSION = '1.1.5'
21
+ VERSION = '1.1.6'
22
22
 
23
23
  @@windows = Config::CONFIG['host_os'] =~ /mswin|win32|dos/i
24
24
 
@@ -88,8 +88,6 @@ module DBI
88
88
  #
89
89
  def initialize(database, user=nil, dbrc_dir=nil)
90
90
  if dbrc_dir.nil?
91
- raise Error, 'bad directory' unless File.directory?(dbrc_dir)
92
-
93
91
  uid = Process.uid
94
92
  home = ENV['HOME'] || ENV['USERPROFILE']
95
93
 
@@ -109,6 +107,7 @@ module DBI
109
107
  @dbrc_file = File.join(Sys::Admin.get_user(uid).dir, '.dbrc')
110
108
  end
111
109
  else
110
+ raise Error, 'bad directory' unless File.directory?(dbrc_dir)
112
111
  @dbrc_file = File.join(dbrc_dir, '.dbrc')
113
112
  end
114
113
 
@@ -36,7 +36,7 @@ class TC_DBI_DBRC < Test::Unit::TestCase
36
36
  end
37
37
 
38
38
  def test_version
39
- assert_equal('1.1.5', DBRC::VERSION)
39
+ assert_equal('1.1.6', DBRC::VERSION)
40
40
  end
41
41
 
42
42
  def test_bad_dbrc_properties
@@ -56,11 +56,15 @@ class TC_DBI_DBRC < Test::Unit::TestCase
56
56
  end
57
57
 
58
58
  def test_bad_database
59
- assert_raises(DBRC::Error){ DBRC.new(@db_bad, nil, @dir) }
59
+ assert_raise(DBRC::Error){ DBRC.new(@db_bad, nil, @dir) }
60
60
  end
61
61
 
62
62
  def test_bad_user
63
- assert_raises(DBRC::Error){ DBRC.new(@db1, @user_bad, @dir) }
63
+ assert_raise(DBRC::Error){ DBRC.new(@db1, @user_bad, @dir) }
64
+ end
65
+
66
+ def test_bad_dir
67
+ assert_raise(DBI::DBRC::Error){ DBI::DBRC.new(@db1, @user1, '/bogusXX') }
64
68
  end
65
69
 
66
70
  def test_database
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbi-dbrc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Berger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-03 00:00:00 -06:00
12
+ date: 2009-09-10 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency