diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/test-custodian-parser.rb | 22 | ||||
-rwxr-xr-x | t/test-custodian-settings.rb | 13 | ||||
-rwxr-xr-x | t/test-custodian-util-ping.rb | 2 | ||||
-rwxr-xr-x | t/test-custodian-util-timespan.rb | 2 | ||||
-rwxr-xr-x | t/test-rubocop.rb | 2 |
5 files changed, 21 insertions, 20 deletions
diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index 2239503..62a39dc 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -438,15 +438,15 @@ EOF # test data # data = { - 'http://bob:steve@example must run http.' => - { username: 'bob', password: 'steve'}, + 'http://bob:steve@example must run http.' => + { :username => 'bob', :password => 'steve' }, 'http://stee\':steve@example must run http.' => - { username: 'stee\'', password: 'steve'}, + { :username => 'stee\'', :password => 'steve' }, 'http://e\'e:pa$$w0rd@example must run http.' => - { username: 'e\'e', password: 'pa$$w0rd'}, + { :username => 'e\'e', :password => 'pa$$w0rd' } } - data.each do |str, hash | + data.each do |str, hash| assert_nothing_raised do # @@ -461,8 +461,8 @@ EOF # There should be auth-enabled assert(obj[0].basic_auth?) - assert(obj[0].basic_auth_username == hash[:username] ) - assert(obj[0].basic_auth_password == hash[:password] ) + assert(obj[0].basic_auth_username == hash[:username]) + assert(obj[0].basic_auth_password == hash[:password]) end end @@ -488,7 +488,7 @@ EOF # # Test the parser with this text # - expiries.each do |str,days| + expiries.each do |str, days| assert_nothing_raised do # @@ -505,13 +505,13 @@ EOF # Test both of them to make sure we got our expiry period. obj.each do |x| - if ( x.class.name =~ /SSL/ ) - found_days = x.expiry_days + if (x.class.name =~ /SSL/) + found_days = x.expiry_days end end # Ensure we did find a match. - assert(found_days != -1 ) + assert(found_days != -1) assert(found_days == days) end diff --git a/t/test-custodian-settings.rb b/t/test-custodian-settings.rb index 74f881b..1630859 100755 --- a/t/test-custodian-settings.rb +++ b/t/test-custodian-settings.rb @@ -47,36 +47,37 @@ class TestConfigurationSingleton < Test::Unit::TestCase # retry delay - probably unset. a = settings.retry_delay - assert(a.class == Fixnum) + assert(a.class == Integer || + a.class == Fixnum) # store a number settings._store('retry_delay', 5) a = settings.retry_delay - assert(a.class == Fixnum) + assert(a.class == Integer || a.class == Fixnum ) assert(a == 5) # store a string settings._store('retry_delay', '35') a = settings.retry_delay - assert(a.class == Fixnum) + assert(a.class == Integer || a.class == Fixnum ) assert(a == 35) # timeout - probably unset. a = settings.timeout - assert(a.class == Fixnum) + assert(a.class == Integer || a.class == Fixnum ) # store a number settings._store('timeout', 5) a = settings.timeout - assert(a.class == Fixnum) + assert(a.class == Integer || a.class == Fixnum ) assert(a == 5) # store a string settings._store('timeout', '35') a = settings.timeout - assert(a.class == Fixnum) + assert(a.class == Integer || a.class == Fixnum ) assert(a == 35) diff --git a/t/test-custodian-util-ping.rb b/t/test-custodian-util-ping.rb index 99b61c1..d7d16b8 100755 --- a/t/test-custodian-util-ping.rb +++ b/t/test-custodian-util-ping.rb @@ -63,7 +63,7 @@ class TestPingUtil < Test::Unit::TestCase # Test lookup of hosts that don't work # def test_lookup_fail - %w( tessf.dfsdf.sdf.sdfsdf fdsfkljflj3.fdsfds.f3.dfs ).each do |name| + %w(tessf.dfsdf.sdf.sdfsdf fdsfkljflj3.fdsfds.f3.dfs).each do |name| assert_nothing_raised do helper = Custodian::Util::Ping.new(name) diff --git a/t/test-custodian-util-timespan.rb b/t/test-custodian-util-timespan.rb index fec079f..5098589 100755 --- a/t/test-custodian-util-timespan.rb +++ b/t/test-custodian-util-timespan.rb @@ -214,7 +214,7 @@ class TestTimeSpanUtil < Test::Unit::TestCase # def test_wrap_around - for h in 00..23 + for h in 0o0..23 assert_equal(1, Custodian::Util::TimeSpan.to_hours(h, h).size) end diff --git a/t/test-rubocop.rb b/t/test-rubocop.rb index 57457b7..cb597e8 100755 --- a/t/test-rubocop.rb +++ b/t/test-rubocop.rb @@ -20,7 +20,7 @@ class TestRubocop < Test::Unit::TestCase cli = RuboCop::CLI.new result = cli.run - assert(result == 0, 'No errors found') + assert(result.zero?, 'No errors found') rescue LoadError => ex if methods.include?(:skip) |