dbi-dbrc 1.1.9 → 1.5.0

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/Rakefile CHANGED
@@ -1,45 +1,26 @@
1
1
  require 'rake'
2
2
  require 'rake/clean'
3
- require 'rake/testtask'
3
+ require 'rspec/core/rake_task'
4
4
 
5
- CLEAN.include("**/*.gem", "**/*.rbc")
5
+ CLEAN.include("**/*.gem", "**/*.rbc", "**/*.lock")
6
6
 
7
7
  namespace :gem do
8
- desc "Remove any gem files."
9
- task :clean do
10
- Dir['*.gem'].each{ |f| File.delete(f) }
11
- end
12
-
13
8
  desc "Create the dbi-dbrc gem"
14
9
  task :create => [:clean] do
10
+ require 'rubygems/package'
15
11
  spec = eval(IO.read('dbi-dbrc.gemspec'))
16
- Gem::Builder.new(spec).build
12
+ spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
+ Gem::Package.build(spec, true)
17
14
  end
18
15
 
19
16
  desc "Install the dbi-dbrc gem"
20
17
  task :install => [:create] do
21
18
  gem = Dir["*.gem"].first
22
- sh "gem install #{gem}"
19
+ sh "gem install -l #{gem}"
23
20
  end
24
21
  end
25
22
 
26
- namespace :test do
27
- Rake::TestTask.new(:all) do |t|
28
- t.warning = true
29
- t.verbose = true
30
- end
31
-
32
- Rake::TestTask.new(:xml) do |t|
33
- t.warning = true
34
- t.verbose = true
35
- t.test_files = FileList['test/test_dbi_dbrc_xml.rb']
36
- end
37
-
38
- Rake::TestTask.new(:yml) do |t|
39
- t.warning = true
40
- t.verbose = true
41
- t.test_files = FileList['test/test_dbi_dbrc_yml.rb']
42
- end
43
- end
23
+ desc "Run the test suite"
24
+ RSpec::Core::RakeTask.new(:spec)
44
25
 
45
- task :default => 'test:all'
26
+ task :default => :spec
@@ -0,0 +1,26 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
3
+ cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
4
+ MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
5
+ ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
6
+ bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
7
+ A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
8
+ u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
9
+ 75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
10
+ 6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
11
+ iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
12
+ ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
13
+ 74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
14
+ 058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
15
+ HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
16
+ AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
17
+ YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
18
+ /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
19
+ h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
20
+ 6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
21
+ ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
22
+ 1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
23
+ DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
24
+ ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
25
+ WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
26
+ -----END CERTIFICATE-----
data/dbi-dbrc.gemspec CHANGED
@@ -2,25 +2,34 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'dbi-dbrc'
5
- spec.version = '1.1.9'
5
+ spec.version = '1.5.0'
6
6
  spec.author = 'Daniel Berger'
7
7
  spec.email = 'djberg96@gmail.com'
8
- spec.license = 'Artistic 2.0'
8
+ spec.license = 'Apache-2.0'
9
9
  spec.summary = 'A simple way to avoid hard-coding passwords with DBI'
10
10
  spec.homepage = 'https://github.com/djberg96/dbi-dbrc'
11
11
  spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
12
12
  spec.test_files = Dir['test/test*.rb']
13
+ spec.cert_chain = Dir['certs/*']
13
14
 
14
- spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
15
- spec.rubyforge_project = 'shards'
15
+ spec.add_development_dependency('rake')
16
+ spec.add_development_dependency('rspec', '~> 3.9')
17
+ spec.add_development_dependency('fakefs', '~> 1.3')
16
18
 
17
- spec.add_dependency('sys-admin', '>= 1.5.2')
18
- spec.add_development_dependency('test-unit')
19
+ spec.metadata = {
20
+ 'homepage_uri' => 'https://github.com/djberg96/dbi-dbrc',
21
+ 'bug_tracker_uri' => 'https://github.com/djberg96/dbi-dbrc/issues',
22
+ 'changelog_uri' => 'https://github.com/djberg96/dbi-dbrc/blob/main/CHANGES',
23
+ 'documentation_uri' => 'https://github.com/djberg96/dbi-dbrc/wiki',
24
+ 'source_code_uri' => 'https://github.com/djberg96/dbi-dbrc',
25
+ 'wiki_uri' => 'https://github.com/djberg96/dbi-dbrc/wiki'
26
+ }
19
27
 
20
28
  if File::ALT_SEPARATOR
21
- spec.add_dependency('win32-file', '>= 0.6.6')
22
- spec.add_dependency('win32-dir', '>= 0.3.7')
23
- spec.add_dependency('win32-process', '>= 0.6.2')
29
+ spec.add_dependency('sys-admin')
30
+ spec.add_dependency('win32-file-attributes')
31
+ spec.add_dependency('win32-dir')
32
+ spec.add_dependency('win32-process')
24
33
  spec.platform = Gem::Platform::CURRENT
25
34
  spec.platform.cpu = 'universal'
26
35
  end
@@ -1,12 +1,12 @@
1
1
  #######################################################################
2
- # test_xml.rb
2
+ # test_yml.rb
3
3
  #
4
- # Simple test script that uses the DBRC::XML subclass.
4
+ # Simple test script that uses the DBRC::YML subclass.
5
5
  #######################################################################
6
6
  if File.basename(Dir.pwd) == "yml"
7
- Dir.chdir "../.."
8
- $LOAD_PATH.unshift Dir.pwd + "/lib"
9
- Dir.chdir "examples/yml"
7
+ Dir.chdir "../.."
8
+ $LOAD_PATH.unshift Dir.pwd + "/lib"
9
+ Dir.chdir "examples/yml"
10
10
  end
11
11
 
12
12
  require "dbi/dbrc"
data/lib/dbi-dbrc.rb ADDED
@@ -0,0 +1 @@
1
+ require_relative 'dbi/dbrc'
data/lib/dbi/dbrc.rb CHANGED
@@ -1,10 +1,12 @@
1
1
  if File::ALT_SEPARATOR
2
2
  require 'win32/dir'
3
- require 'win32/file'
3
+ require 'win32/file/attributes'
4
4
  require 'win32/process'
5
+ require 'sys/admin'
6
+ else
7
+ require 'etc'
5
8
  end
6
9
 
7
- require 'sys/admin'
8
10
 
9
11
  # The DBI module serves as a namespace only.
10
12
  module DBI
@@ -16,19 +18,27 @@ module DBI
16
18
  class Error < StandardError; end
17
19
 
18
20
  # The version of the dbi-dbrc library
19
- VERSION = '1.1.9'
21
+ VERSION = '1.5.0'.freeze
20
22
 
21
- @@windows = File::ALT_SEPARATOR
23
+ WINDOWS = File::ALT_SEPARATOR # :no-doc:
22
24
 
23
25
  # The database or host to be connected to.
24
26
  attr_accessor :database
25
27
 
28
+ alias :db :database
29
+ alias :db= :database=
30
+ alias :host :database
31
+ alias :host= :database=
32
+
26
33
  # The user name used for the database or host connection.
27
34
  attr_accessor :user
28
35
 
29
36
  # The password associated with the database or host.
30
37
  attr_accessor :password
31
38
 
39
+ alias :passwd :password
40
+ alias :passwd= :password=
41
+
32
42
  # The driver associated with the database. This is used to internally to
33
43
  # construct the DSN.
34
44
  attr_accessor :driver
@@ -39,9 +49,15 @@ module DBI
39
49
  # The maximum number of reconnects a program should make before giving up.
40
50
  attr_accessor :maximum_reconnects
41
51
 
52
+ alias :max_reconn :maximum_reconnects
53
+ alias :max_reconn= :maximum_reconnects=
54
+
42
55
  # The timeout, in seconds, for each connection attempt.
43
56
  attr_accessor :timeout
44
57
 
58
+ alias :time_out :timeout
59
+ alias :time_out= :timeout=
60
+
45
61
  # The interval, in seconds, between each connection attempt.
46
62
  attr_accessor :interval
47
63
 
@@ -85,21 +101,16 @@ module DBI
85
101
  #
86
102
  def initialize(database, user=nil, dbrc_dir=nil)
87
103
  if dbrc_dir.nil?
88
- uid = Process.uid
89
- home = ENV['HOME'] || ENV['USERPROFILE']
90
-
91
- if home.nil?
92
- if @@windows
93
- home ||= Sys::Admin.get_user(uid, :localaccount => true).dir
94
- else
95
- home ||= Sys::Admin.get_user(uid).dir
96
- end
104
+ if WINDOWS
105
+ home = Sys::Admin.get_user(Process.uid, :localaccount => true).dir
106
+ else
107
+ home = Dir.home(Etc.getpwuid.name)
97
108
  end
98
109
 
99
110
  # Default to the app data directory on Windows, or root on Unix, if
100
111
  # no home dir can be found.
101
112
  if home.nil?
102
- if @@windows
113
+ if WINDOWS
103
114
  home = Dir::APPDATA
104
115
  else
105
116
  home = '/'
@@ -107,6 +118,7 @@ module DBI
107
118
  end
108
119
 
109
120
  @dbrc_file = File.join(home, '.dbrc')
121
+ dbrc_dir = home
110
122
  else
111
123
  raise Error, 'bad directory' unless File.directory?(dbrc_dir)
112
124
  @dbrc_file = File.join(dbrc_dir, '.dbrc')
@@ -128,7 +140,7 @@ module DBI
128
140
  # Decrypt and re-encrypt the file if we're on MS Windows and the
129
141
  # file is encrypted.
130
142
  begin
131
- if @@windows && File.encrypted?(@dbrc_file)
143
+ if WINDOWS && File.encrypted?(@dbrc_file)
132
144
  file_was_encrypted = true
133
145
  File.decrypt(@dbrc_file)
134
146
  end
@@ -138,7 +150,7 @@ module DBI
138
150
  convert_numeric_strings()
139
151
  create_dsn_string()
140
152
  ensure
141
- if @@windows && file_was_encrypted
153
+ if WINDOWS && file_was_encrypted
142
154
  File.encrypt(@dbrc_file)
143
155
  end
144
156
  end
@@ -189,7 +201,7 @@ module DBI
189
201
  File.open(file){ |f|
190
202
  # Permissions must be set to 600 or better on Unix systems.
191
203
  # Must be hidden on Win32 systems.
192
- if @@windows
204
+ if WINDOWS
193
205
  unless File.hidden?(file)
194
206
  raise Error, "The .dbrc file must be hidden"
195
207
  end
@@ -209,50 +221,41 @@ module DBI
209
221
  # Parse the text out of the .dbrc file. This is the only method you
210
222
  # need to redefine if writing your own config handler.
211
223
  def parse_dbrc_config_file(file=@dbrc_file)
212
- IO.foreach(file){ |line|
213
- next if line =~ /^#/ # Ignore comments
214
- db, user, pwd, driver, timeout, max, interval = line.split
224
+ File.foreach(file){ |line|
225
+ next if line =~ /^#/ # Ignore comments
226
+ db, user, pwd, driver, timeout, max, interval = line.split
215
227
 
216
- next unless @database == db
228
+ next unless @database == db
217
229
 
218
- if @user
219
- next unless @user == user
220
- end
230
+ if @user
231
+ next unless @user == user
232
+ end
221
233
 
222
- @user = user
223
- @password = pwd
224
- @driver = driver
225
- @timeout = timeout
226
- @maximum_reconnects = max
227
- @interval = interval
228
- return
229
- }
234
+ @user = user
235
+ @password = pwd
236
+ @driver = driver
237
+ @timeout = timeout
238
+ @maximum_reconnects = max
239
+ @interval = interval
240
+ return
241
+ }
230
242
 
231
- # If we reach here it means the database and/or user wasn't found
232
- if @user
233
- err = "no record found for #{@user}@#{@database}"
234
- else
235
- err = "no record found for #{@database}"
236
- end
243
+ # If we reach here it means the database and/or user wasn't found
244
+ if @user
245
+ err = "no record found for #{@user}@#{@database}"
246
+ else
247
+ err = "no record found for #{@database}"
248
+ end
237
249
 
238
- raise Error, err
250
+ raise Error, err
239
251
  end
240
252
 
241
- alias_method(:db, :database)
242
- alias_method(:db=, :database=)
243
- alias_method(:passwd, :password)
244
- alias_method(:passwd=, :password=)
245
- alias_method(:max_reconn, :maximum_reconnects)
246
- alias_method(:max_reconn=, :maximum_reconnects=)
247
- alias_method(:time_out, :timeout)
248
- alias_method(:time_out=, :timeout=)
249
- alias_method(:host, :database)
250
253
  end
251
254
 
252
255
  # A subclass of DBRC designed to handle .dbrc files in XML format. The
253
256
  # public methods of this class are identical to DBRC.
254
- class XML < DBRC
255
- require "rexml/document"
257
+ class DBRC::XML < DBRC
258
+ require 'rexml/document' # Good enough for small files
256
259
  include REXML
257
260
 
258
261
  private
@@ -280,8 +283,8 @@ module DBI
280
283
 
281
284
  # A subclass of DBRC designed to handle .dbrc files in YAML format. The
282
285
  # public methods of this class are identical to DBRC.
283
- class YML < DBRC
284
- require "yaml"
286
+ class DBRC::YML < DBRC
287
+ require 'yaml'
285
288
 
286
289
  private
287
290
 
@@ -296,7 +299,7 @@ module DBI
296
299
  @driver = info["driver"]
297
300
  @interval = info["interval"]
298
301
  @timeout = info["timeout"]
299
- @maximum_reconnects = info["max_reconn"]
302
+ @maximum_reconnects = info["maximum_reconnects"]
300
303
  return
301
304
  }
302
305
  }
@@ -0,0 +1,236 @@
1
+ #########################################################################
2
+ # dbi_dbrc_spec.rb
3
+ #
4
+ # Specs for the base class of DBI::DBRC. This test case should be
5
+ # run via the 'rake spec' task.
6
+ #########################################################################
7
+ require 'dbi/dbrc'
8
+ require 'fileutils'
9
+ require 'spec_helper'
10
+ require 'pp' # Requiring this ahead of fakefs to address a superclass issue.
11
+ require 'fakefs/spec_helpers'
12
+
13
+ RSpec.describe DBI::DBRC do
14
+ include FakeFS::SpecHelpers
15
+
16
+ let(:windows) { File::ALT_SEPARATOR }
17
+ let(:home) { File.join(Dir.pwd, 'home', 'someone') }
18
+ let(:dbrc) { File.join(home, '.dbrc') }
19
+
20
+ let(:plain) {
21
+ %q{
22
+ foo user1 pwd1 Oracle 40 3 60
23
+ foo user2 pwd2 OCI8 60 4 60
24
+ bar user1 pwd3 Oracle 30 2 30
25
+ baz user3 pwd4
26
+ }.lstrip
27
+ }
28
+
29
+ let(:db_foo){ 'foo' }
30
+ let(:db_bar){ 'bar' }
31
+ let(:db_baz){ 'baz' }
32
+ let(:user1) { 'user1' }
33
+ let(:user2) { 'user2' }
34
+
35
+ before do
36
+ allow(Dir).to receive(:home).and_return(home)
37
+ FileUtils.mkdir_p(home)
38
+ File.open(dbrc, 'w'){ |fh| fh.write(plain) }
39
+ File.chmod(0600, dbrc)
40
+
41
+ # FakeFS doesn't implement this yet
42
+ allow_any_instance_of(FakeFS::File::Stat).to receive(:owned?).and_return(true)
43
+ end
44
+
45
+ example "version" do
46
+ expect(described_class::VERSION).to eq('1.5.0')
47
+ expect(described_class::VERSION).to be_frozen
48
+ end
49
+
50
+ context "windows", :windows => true do
51
+ example "constructor raises an error unless the .dbrc file is hidden" do
52
+ File.unset_attr(plain, File::HIDDEN)
53
+ expect{ described_class.new(db_foo, user1) }.to raise_error(described_class::Error)
54
+ end
55
+ end
56
+
57
+ context "constructor" do
58
+ example "constructor raises an error if the permissions are invalid" do
59
+ File.chmod(0555, dbrc)
60
+ expect{ described_class.new(db_foo, user1) }.to raise_error(described_class::Error)
61
+ end
62
+
63
+ example "constructor raises an error if no database is provided" do
64
+ expect{ described_class.new }.to raise_error(ArgumentError)
65
+ end
66
+
67
+ example "constructor works as expected with or without user" do
68
+ expect{ described_class.new(db_foo, user1) }.not_to raise_error
69
+ expect{ described_class.new(db_foo, nil) }.not_to raise_error
70
+ end
71
+
72
+ example "constructor fails if the database entry doesn't exist" do
73
+ expect{ described_class.new('bogus', user1) }.to raise_error(DBI::DBRC::Error)
74
+ end
75
+
76
+ example "constructor fails if the user entry doesn't exist" do
77
+ expect{ described_class.new(db_foo, 'nobody') }.to raise_error(DBI::DBRC::Error)
78
+ end
79
+
80
+ example "constructor fails if the .dbrc file isn't found in the specified directory" do
81
+ expect{ described_class.new(db_foo, user1, '/bogusXX') }.to raise_error(DBI::DBRC::Error)
82
+ end
83
+
84
+ example "constructor returns expected values for the same database with different users" do
85
+ dbrc1 = described_class.new(db_foo, user1)
86
+ dbrc2 = described_class.new(db_foo, user2)
87
+ expect(dbrc1.database).to eq(dbrc2.database)
88
+ expect(dbrc1.user).to eq('user1')
89
+ expect(dbrc2.user).to eq('user2')
90
+ end
91
+
92
+ example "constructor returns expected values for the same user with different database" do
93
+ dbrc1 = described_class.new(db_foo, user1)
94
+ dbrc2 = described_class.new(db_bar, user1)
95
+ expect(dbrc1.user).to eq(dbrc2.user)
96
+ expect(dbrc1.database).to eq('foo')
97
+ expect(dbrc2.database).to eq('bar')
98
+ end
99
+
100
+ example "constructor works as expected if some optional fields are not defined" do
101
+ dbrc = described_class.new(db_baz)
102
+ expect(dbrc.user).to eq("user3")
103
+ expect(dbrc.passwd).to eq("pwd4")
104
+ expect(dbrc.driver).to be_nil
105
+ expect(dbrc.interval).to be_nil
106
+ expect(dbrc.timeout).to be_nil
107
+ expect(dbrc.max_reconn).to be_nil
108
+ expect(dbrc.dsn).to be_nil
109
+ end
110
+ end
111
+
112
+ context "instance methods" do
113
+ before do
114
+ @dbrc = DBI::DBRC.new(db_foo)
115
+ end
116
+
117
+ example "basic database getter method and aliases" do
118
+ expect(@dbrc).to respond_to(:database)
119
+ expect(@dbrc.method(:database)).to eq(@dbrc.method(:db))
120
+ expect(@dbrc.method(:database)).to eq(@dbrc.method(:host))
121
+ end
122
+
123
+ example "basic database setter method and alias" do
124
+ expect(@dbrc).to respond_to(:database=)
125
+ expect(@dbrc.method(:database=)).to eq(@dbrc.method(:db=))
126
+ end
127
+
128
+ example "database method returns expected value" do
129
+ expect(@dbrc.database).to eq('foo')
130
+ end
131
+
132
+ example "basic dbrc_dir check" do
133
+ expect(@dbrc).to respond_to(:dbrc_dir)
134
+ end
135
+
136
+ example "dbrc_dir returns the expected value" do
137
+ expect(@dbrc.dbrc_dir).to eq(home)
138
+ end
139
+
140
+ example "basic dbrc_file check" do
141
+ expect(@dbrc).to respond_to(:dbrc_file)
142
+ end
143
+
144
+ example "dbrc_file returns the expected value" do
145
+ expect(File.basename(@dbrc.dbrc_file)).to eq('.dbrc')
146
+ end
147
+
148
+ example "basic dsn getter check" do
149
+ expect(@dbrc).to respond_to(:dsn)
150
+ end
151
+
152
+ example "dsn method returns the expected value" do
153
+ expect(@dbrc.dsn).to eq('dbi:Oracle:foo')
154
+ end
155
+
156
+ example "basic dsn setter check" do
157
+ expect(@dbrc).to respond_to(:dsn=)
158
+ end
159
+
160
+ example "user getter basic check" do
161
+ expect(@dbrc).to respond_to(:user)
162
+ end
163
+
164
+ example "user method returns expected value" do
165
+ expect(@dbrc.user).to eq('user1')
166
+ end
167
+
168
+ example "user setter basic check" do
169
+ expect(@dbrc).to respond_to(:user=)
170
+ end
171
+
172
+ example "password getter basic check and alias" do
173
+ expect(@dbrc).to respond_to(:password)
174
+ expect(@dbrc.method(:password)).to eq(@dbrc.method(:passwd))
175
+ end
176
+
177
+ example "password method returns expected value" do
178
+ expect(@dbrc.password).to eq("pwd1")
179
+ end
180
+
181
+ example "password setter basic check and alias" do
182
+ expect(@dbrc).to respond_to(:password=)
183
+ expect(@dbrc.method(:password=)).to eq(@dbrc.method(:passwd=))
184
+ end
185
+
186
+ example "driver getter basic check" do
187
+ expect(@dbrc).to respond_to(:driver)
188
+ end
189
+
190
+ example "driver method returns expected value" do
191
+ expect(@dbrc.driver).to eq("Oracle")
192
+ end
193
+
194
+ example "driver setter basic check" do
195
+ expect(@dbrc).to respond_to(:driver=)
196
+ end
197
+
198
+ example "interval getter basic check" do
199
+ expect(@dbrc).to respond_to(:interval)
200
+ end
201
+
202
+ example "interval method returns expected value" do
203
+ expect(@dbrc.interval).to eq(60)
204
+ end
205
+
206
+ example "interval setter basic check" do
207
+ expect(@dbrc).to respond_to(:interval=)
208
+ end
209
+
210
+ example "timeout getter basic check" do
211
+ expect(@dbrc).to respond_to(:timeout)
212
+ expect(@dbrc.method(:timeout)).to eq(@dbrc.method(:time_out))
213
+ end
214
+
215
+ example "timeout method returns expected value" do
216
+ expect(@dbrc.timeout).to eq(40)
217
+ end
218
+
219
+ example "timeout setter basic check" do
220
+ expect(@dbrc).to respond_to(:timeout=)
221
+ end
222
+
223
+ example "max_reconn getter basic check" do
224
+ expect(@dbrc).to respond_to(:max_reconn)
225
+ expect(@dbrc.method(:max_reconn)).to eq(@dbrc.method(:maximum_reconnects))
226
+ end
227
+
228
+ example "max_reconn method returns expected value" do
229
+ expect(@dbrc.max_reconn).to eq(3)
230
+ end
231
+
232
+ example "max_reconn setter basic check" do
233
+ expect(@dbrc).to respond_to(:max_reconn=)
234
+ end
235
+ end
236
+ end