From e716a49dabe2c086a97e2d8b3cffe5cf369ad026 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 9 Mar 2015 13:19:47 +0000 Subject: Removed spaces inside parenthesis. --- t/test-custodian-alertfactory.rb | 22 +++---- t/test-custodian-parser.rb | 130 +++++++++++++++++++------------------- t/test-custodian-queue.rb | 6 +- t/test-custodian-settings.rb | 34 +++++----- t/test-custodian-testfactory.rb | 114 ++++++++++++++++----------------- t/test-custodian-util-bytemark.rb | 4 +- t/test-custodian-util-dns.rb | 36 +++++------ t/test-custodian-util-ping.rb | 24 +++---- t/test-custodian-util-timespan.rb | 98 ++++++++++++++-------------- t/test-http-vs-https.rb | 28 ++++---- t/test-ldap-probe.rb | 14 ++-- 11 files changed, 255 insertions(+), 255 deletions(-) (limited to 't') diff --git a/t/test-custodian-alertfactory.rb b/t/test-custodian-alertfactory.rb index eea35ac..c18e719 100755 --- a/t/test-custodian-alertfactory.rb +++ b/t/test-custodian-alertfactory.rb @@ -31,8 +31,8 @@ class TestAlertFactory < Test::Unit::TestCase # Ensure we can create each of the two alert types we care about # methods = [] - methods.push( 'file' ) - methods.push( 'smtp' ) + methods.push('file') + methods.push('smtp') # # Mauve + Redis are optional @@ -54,29 +54,29 @@ class TestAlertFactory < Test::Unit::TestCase mauve = false end - methods.push( 'redis' ) if redis - methods.push( 'mauve' ) if mauve + methods.push('redis') if redis + methods.push('mauve') if mauve methods.each do |name| # # Use the factory to instantiate the correct object. # - obj = Custodian::AlertFactory.create( name, nil ) + obj = Custodian::AlertFactory.create(name, nil) # # Get the name of the class, and ensure it matches # what we expect. # a_type = obj.get_type - assert_equal( name, a_type) + assert_equal(name, a_type) # # Ensure that the object implements the raise() + clear() # methods we mandate. # - assert( obj.respond_to? 'raise' ) - assert( obj.respond_to? 'clear' ) + assert(obj.respond_to? 'raise') + assert(obj.respond_to? 'clear') end @@ -84,17 +84,17 @@ class TestAlertFactory < Test::Unit::TestCase # Creating an alert we don't know about is an error # assert_raise ArgumentError do - obj = Custodian::AlertFactory.create( 'not found', nil ) + obj = Custodian::AlertFactory.create('not found', nil) end # # A string is mandatory # assert_raise ArgumentError do - obj = Custodian::AlertFactory.create( nil, nil ) + obj = Custodian::AlertFactory.create(nil, nil) end assert_raise ArgumentError do - obj = Custodian::AlertFactory.create( [], nil ) + obj = Custodian::AlertFactory.create([], nil) end end diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index bbdb8ad..514f2a4 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -51,8 +51,8 @@ class TestCustodianParser < Test::Unit::TestCase def test_period parser = Custodian::Parser.new - result = parser.parse_line( 'example.vm.bytemark.co.uk must run ping except between 00-23' ) - assert( result.nil? ) + result = parser.parse_line('example.vm.bytemark.co.uk must run ping except between 00-23') + assert(result.nil?) end @@ -72,20 +72,20 @@ class TestCustodianParser < Test::Unit::TestCase parser = Custodian::Parser.new # 1.a. Comment lines return nil. - result = parser.parse_line( '# this is a comment' ) - assert( result.nil? ) + result = parser.parse_line('# this is a comment') + assert(result.nil?) # 1.b. Non-strings are an error assert_raise ArgumentError do - result = parser.parse_line( nil ) + result = parser.parse_line(nil) end # 1.c. Adding a test will return an array of test-objects. - result = parser.parse_line( "smtp.bytemark.co.uk must run smtp on 25 otherwise 'failure'." ) - assert( !result.nil? ) - assert( result.kind_of? Array ) - assert( result.size == 1 ) + result = parser.parse_line("smtp.bytemark.co.uk must run smtp on 25 otherwise 'failure'.") + assert(!result.nil?) + assert(result.kind_of? Array) + assert(result.size == 1) # @@ -94,15 +94,15 @@ class TestCustodianParser < Test::Unit::TestCase parser = Custodian::Parser.new # 2.a. Comment lines return nil. tmp = [] - tmp.push( '# This is a comment..' ) - assert( parser.parse_lines( tmp ).nil? ) + tmp.push('# This is a comment..') + assert(parser.parse_lines(tmp).nil?) # 2.b. Adding a test will return an array of test-objects. tmp = [] - tmp.push( "smtp.bytemark.co.uk must run ssh on 22 otherwise 'oops'." ) - ret = parser.parse_lines( tmp ) - assert( ret.kind_of? Array ) - assert( ret.size == 1 ) + tmp.push("smtp.bytemark.co.uk must run ssh on 22 otherwise 'oops'.") + ret = parser.parse_lines(tmp) + assert(ret.kind_of? Array) + assert(ret.size == 1) # # 3. By lines @@ -113,16 +113,16 @@ class TestCustodianParser < Test::Unit::TestCase # This is a comment # This is also a fine comment EOF - assert( parser.parse_lines( str ).nil? ) + assert(parser.parse_lines(str).nil?) # 3.b. Adding a test will return an array of test-objects. str = < #{inv}" ) + assert(obj[0].inverted == inv, "#{str} -> #{inv}") end end @@ -269,14 +269,14 @@ class TestTestFactory < Test::Unit::TestCase assert_nothing_raised do - test_one_obj = Custodian::TestFactory.create( test_one ) - assert( !test_one_obj[0].inverted ) + test_one_obj = Custodian::TestFactory.create(test_one) + assert(!test_one_obj[0].inverted) - test_two_obj = Custodian::TestFactory.create( test_two ) - assert( test_two_obj[0].inverted, "Found inverted test for #{tst}" ) + test_two_obj = Custodian::TestFactory.create(test_two) + assert(test_two_obj[0].inverted, "Found inverted test for #{tst}") - assert_equal( tst, test_one_obj[0].get_type ) - assert_equal( tst, test_two_obj[0].get_type ) + assert_equal(tst, test_one_obj[0].get_type) + assert_equal(tst, test_two_obj[0].get_type) end end end @@ -292,21 +292,21 @@ class TestTestFactory < Test::Unit::TestCase a = [] - a.push( 'test.host.example.com must run ftp.') - a.push( 'ftp://test.host.example.com/ must run ftp.') - a.push( 'ftp://test.host.example.com/foo must run ftp.') - a.push( 'test.host.example.com must run ping.') - a.push( "test.host.example.com must run dns for bytemark.co.uk resolving NS as '80.68.80.26;85.17.170.78;80.68.80.27'.") - a.push( 'rsync://test.host.example.com must run rsync.') - a.push( 'rsync://test.host.example.com must run rsync.') + a.push('test.host.example.com must run ftp.') + a.push('ftp://test.host.example.com/ must run ftp.') + a.push('ftp://test.host.example.com/foo must run ftp.') + a.push('test.host.example.com must run ping.') + a.push("test.host.example.com must run dns for bytemark.co.uk resolving NS as '80.68.80.26;85.17.170.78;80.68.80.27'.") + a.push('rsync://test.host.example.com must run rsync.') + a.push('rsync://test.host.example.com must run rsync.') a.each do |entry| assert_nothing_raised do - obj = Custodian::TestFactory.create( entry ) + obj = Custodian::TestFactory.create(entry) assert(obj) - assert( obj.kind_of? Array ) - assert( ! obj.empty? ) - assert_equal( 'test.host.example.com', obj[0].target ) + assert(obj.kind_of? Array) + assert(! obj.empty?) + assert_equal('test.host.example.com', obj[0].target) end end end diff --git a/t/test-custodian-util-bytemark.rb b/t/test-custodian-util-bytemark.rb index 30bb480..3b17f4f 100755 --- a/t/test-custodian-util-bytemark.rb +++ b/t/test-custodian-util-bytemark.rb @@ -53,9 +53,9 @@ class TestBytemarkUtil < Test::Unit::TestCase to_test.each do |name,inside| if inside - assert( Custodian::Util::Bytemark.inside?( name ) == true ) + assert(Custodian::Util::Bytemark.inside?(name) == true) else - assert( Custodian::Util::Bytemark.inside?( name ) == false ) + assert(Custodian::Util::Bytemark.inside?(name) == false) end end diff --git a/t/test-custodian-util-dns.rb b/t/test-custodian-util-dns.rb index 2582d94..399639b 100755 --- a/t/test-custodian-util-dns.rb +++ b/t/test-custodian-util-dns.rb @@ -30,27 +30,27 @@ class TestDNSUtil < Test::Unit::TestCase # def test_lookup - details = Custodian::Util::DNS.hostname_to_ip( 'bytemark.co.uk' ) - assert( ( details == '2001:41c9:0:1019:81::80' ) || - ( details == '80.68.81.80' ) ) + details = Custodian::Util::DNS.hostname_to_ip('bytemark.co.uk') + assert((details == '2001:41c9:0:1019:81::80') || + (details == '80.68.81.80')) - details = Custodian::Util::DNS.hostname_to_ip( 'www.bytemark.co.uk' ) - assert( ( details == '2001:41c9:0:1019:81::80' ) || - ( details == '80.68.81.80' ) ) + details = Custodian::Util::DNS.hostname_to_ip('www.bytemark.co.uk') + assert((details == '2001:41c9:0:1019:81::80') || + (details == '80.68.81.80')) - details = Custodian::Util::DNS.hostname_to_ip( 'ipv4.steve.org.uk' ) - assert( details == '80.68.84.103' ) + details = Custodian::Util::DNS.hostname_to_ip('ipv4.steve.org.uk') + assert(details == '80.68.84.103') - details = Custodian::Util::DNS.hostname_to_ip( 'ipv6.steve.org.uk' ) - assert( details == '2001:41c8:10b:103::10' ) + details = Custodian::Util::DNS.hostname_to_ip('ipv6.steve.org.uk') + assert(details == '2001:41c8:10b:103::10') # # Failure case # - details = Custodian::Util::DNS.hostname_to_ip( 'this.doesnot.exist' ) - assert( details.nil? ) + details = Custodian::Util::DNS.hostname_to_ip('this.doesnot.exist') + assert(details.nil?) end @@ -63,20 +63,20 @@ class TestDNSUtil < Test::Unit::TestCase # # IPv6 lookup # - details = Custodian::Util::DNS.ip_to_hostname( '2001:41c9:0:1019:81::80' ) - assert( details =~ /bytemark(-?hosting)?\.(com|eu|co\.uk)$/i ) + details = Custodian::Util::DNS.ip_to_hostname('2001:41c9:0:1019:81::80') + assert(details =~ /bytemark(-?hosting)?\.(com|eu|co\.uk)$/i) # # IPv4 lookup # - details = Custodian::Util::DNS.ip_to_hostname( '80.68.81.80' ) - assert( details =~ /bytemark(-?hosting)?\.(com|eu|co\.uk)$/i ) + details = Custodian::Util::DNS.ip_to_hostname('80.68.81.80') + assert(details =~ /bytemark(-?hosting)?\.(com|eu|co\.uk)$/i) # # Bogus lookup - should return nil. # - details = Custodian::Util::DNS.ip_to_hostname( '800.683.853.348' ) - assert( details.nil? ) + details = Custodian::Util::DNS.ip_to_hostname('800.683.853.348') + assert(details.nil?) end end diff --git a/t/test-custodian-util-ping.rb b/t/test-custodian-util-ping.rb index e01ef8d..8de1cd5 100755 --- a/t/test-custodian-util-ping.rb +++ b/t/test-custodian-util-ping.rb @@ -41,7 +41,7 @@ class TestPingUtil < Test::Unit::TestCase # A hostname must be supplied # assert_raise ArgumentError do - Custodian::Util::Ping.new( nil ) + Custodian::Util::Ping.new(nil) end @@ -49,10 +49,10 @@ class TestPingUtil < Test::Unit::TestCase # A hostname is a string, not an array, hash, or similar. # assert_raise ArgumentError do - Custodian::Util::Ping.new( {}) + Custodian::Util::Ping.new({}) end assert_raise ArgumentError do - Custodian::Util::Ping.new( []) + Custodian::Util::Ping.new([]) end @@ -64,9 +64,9 @@ class TestPingUtil < Test::Unit::TestCase # def test_lookup_ipv4 - helper = Custodian::Util::Ping.new( 'ipv4.steve.org.uk' ) - assert( helper.is_ipv4? ) - assert( ! helper.is_ipv6? ) + helper = Custodian::Util::Ping.new('ipv4.steve.org.uk') + assert(helper.is_ipv4?) + assert(! helper.is_ipv6?) end @@ -76,9 +76,9 @@ class TestPingUtil < Test::Unit::TestCase # def test_lookup_ipv6 - helper = Custodian::Util::Ping.new( 'ipv6.steve.org.uk' ) - assert( helper.is_ipv6? ) - assert( ! helper.is_ipv4? ) + helper = Custodian::Util::Ping.new('ipv6.steve.org.uk') + assert(helper.is_ipv6?) + assert(! helper.is_ipv4?) end @@ -88,10 +88,10 @@ class TestPingUtil < Test::Unit::TestCase def test_lookup_fail %w( tessf.dfsdf.sdf.sdfsdf fdsfkljflj3.fdsfds.f3.dfs ).each do |name| assert_nothing_raised do - helper = Custodian::Util::Ping.new( name ) + helper = Custodian::Util::Ping.new(name) - assert( ! helper.is_ipv4? ) - assert( ! helper.is_ipv6? ) + assert(! helper.is_ipv4?) + assert(! helper.is_ipv6?) end end diff --git a/t/test-custodian-util-timespan.rb b/t/test-custodian-util-timespan.rb index 210a532..89dfbcd 100755 --- a/t/test-custodian-util-timespan.rb +++ b/t/test-custodian-util-timespan.rb @@ -29,37 +29,37 @@ class TestTimeSpanUtil < Test::Unit::TestCase def test_to_hour for hour in 0..23 - assert_equal( hour, Custodian::Util::TimeSpan.to_hour(hour)) + assert_equal(hour, Custodian::Util::TimeSpan.to_hour(hour)) end # # Invalid hours will throw exceptions # assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.to_hour( 0.5 ) + result = Custodian::Util::TimeSpan.to_hour(0.5) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.to_hour( -1 ) + result = Custodian::Util::TimeSpan.to_hour(-1) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.to_hour( 100 ) + result = Custodian::Util::TimeSpan.to_hour(100) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.to_hour( 24 ) + result = Custodian::Util::TimeSpan.to_hour(24) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.to_hour( 25 ) + result = Custodian::Util::TimeSpan.to_hour(25) end # # Ensure AM times work well # for hour in 0..11 - assert_equal( hour, Custodian::Util::TimeSpan.to_hour( "#{hour}am")) + assert_equal(hour, Custodian::Util::TimeSpan.to_hour("#{hour}am")) end for hour in 0..11 - assert_equal( 12 +hour, Custodian::Util::TimeSpan.to_hour( "#{hour}pm")) + assert_equal(12 +hour, Custodian::Util::TimeSpan.to_hour("#{hour}pm")) end end @@ -76,15 +76,15 @@ class TestTimeSpanUtil < Test::Unit::TestCase # for i in 24..100 assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.inside?( i, 2 ) + result = Custodian::Util::TimeSpan.inside?(i, 2) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.inside?( 1, i ) + result = Custodian::Util::TimeSpan.inside?(1, i) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.inside?( 1, 2, i ) + result = Custodian::Util::TimeSpan.inside?(1, 2, i) end end @@ -94,15 +94,15 @@ class TestTimeSpanUtil < Test::Unit::TestCase for i in 1..50 assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.inside?( 1, ( -1 * i ) ) + result = Custodian::Util::TimeSpan.inside?(1, (-1 * i)) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.inside?( ( -1 * i ), 1 ) + result = Custodian::Util::TimeSpan.inside?((-1 * i), 1) end assert_raise ArgumentError do - result = Custodian::Util::TimeSpan.inside?( 1, 1, ( -1 * i ) ) + result = Custodian::Util::TimeSpan.inside?(1, 1, (-1 * i)) end end @@ -114,8 +114,8 @@ class TestTimeSpanUtil < Test::Unit::TestCase # def test_simple_cases # 8am-5pm - assert(Custodian::Util::TimeSpan.inside?( '8am', '5am', 12 )) - assert(Custodian::Util::TimeSpan.inside?( 8, 17, 12 )) + assert(Custodian::Util::TimeSpan.inside?('8am', '5am', 12)) + assert(Custodian::Util::TimeSpan.inside?(8, 17, 12)) end @@ -125,25 +125,25 @@ class TestTimeSpanUtil < Test::Unit::TestCase def test_midnight_cases # 9pm-2am - assert(Custodian::Util::TimeSpan.inside?( '9pm', '2am', 22 )) - assert(Custodian::Util::TimeSpan.inside?( '9pm', '2am', '10pm' )) - assert(Custodian::Util::TimeSpan.inside?( 21, 2, 22 )) - assert(Custodian::Util::TimeSpan.inside?( 21, 2, '10pm' )) + assert(Custodian::Util::TimeSpan.inside?('9pm', '2am', 22)) + assert(Custodian::Util::TimeSpan.inside?('9pm', '2am', '10pm')) + assert(Custodian::Util::TimeSpan.inside?(21, 2, 22)) + assert(Custodian::Util::TimeSpan.inside?(21, 2, '10pm')) # 10pm-3am - assert(Custodian::Util::TimeSpan.inside?( '10pm', '3am', 22 )) - assert(Custodian::Util::TimeSpan.inside?( 22, 3, 22 )) - assert(Custodian::Util::TimeSpan.inside?( 22, 3, 22 )) - assert(Custodian::Util::TimeSpan.inside?( 22, 3, '10pm' )) + assert(Custodian::Util::TimeSpan.inside?('10pm', '3am', 22)) + assert(Custodian::Util::TimeSpan.inside?(22, 3, 22)) + assert(Custodian::Util::TimeSpan.inside?(22, 3, 22)) + assert(Custodian::Util::TimeSpan.inside?(22, 3, '10pm')) # 11pm-5am - assert(Custodian::Util::TimeSpan.inside?( '11pm', '5am', 23 )) - assert(Custodian::Util::TimeSpan.inside?( 23, 5, 23 )) - assert(Custodian::Util::TimeSpan.inside?( '11pm', '5am', '11pm' )) + assert(Custodian::Util::TimeSpan.inside?('11pm', '5am', 23)) + assert(Custodian::Util::TimeSpan.inside?(23, 5, 23)) + assert(Custodian::Util::TimeSpan.inside?('11pm', '5am', '11pm')) # midnight-3am - assert( Custodian::Util::TimeSpan.inside?( '0', '3am', 1 )) - assert( Custodian::Util::TimeSpan.inside?( '0', '3am', '1am' )) + assert(Custodian::Util::TimeSpan.inside?('0', '3am', 1)) + assert(Custodian::Util::TimeSpan.inside?('0', '3am', '1am')) end @@ -158,38 +158,38 @@ class TestTimeSpanUtil < Test::Unit::TestCase close = '6pm' # The hours + the middle should be inside - assert( Custodian::Util::TimeSpan.inside?( open, close, 16 ) ) - assert( Custodian::Util::TimeSpan.inside?( open, close, '4pm' ) ) + assert(Custodian::Util::TimeSpan.inside?(open, close, 16)) + assert(Custodian::Util::TimeSpan.inside?(open, close, '4pm')) - assert( Custodian::Util::TimeSpan.inside?( open, close, 17 ) ) - assert( Custodian::Util::TimeSpan.inside?( open, close, '5pm' ) ) + assert(Custodian::Util::TimeSpan.inside?(open, close, 17)) + assert(Custodian::Util::TimeSpan.inside?(open, close, '5pm')) - assert( Custodian::Util::TimeSpan.inside?( open, close, 18 ) ) - assert( Custodian::Util::TimeSpan.inside?( open, close, '6pm' ) ) + assert(Custodian::Util::TimeSpan.inside?(open, close, 18)) + assert(Custodian::Util::TimeSpan.inside?(open, close, '6pm')) # # The preceeding + successive hours shouldn't be. # - assert( ! Custodian::Util::TimeSpan.inside?( open, close, 15 ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, 19 ) ) + assert(! Custodian::Util::TimeSpan.inside?(open, close, 15)) + assert(! Custodian::Util::TimeSpan.inside?(open, close, 19)) # # That is true for the string-versions too # - assert( ! Custodian::Util::TimeSpan.inside?( open, close, '3pm' ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, '7pm' ) ) + assert(! Custodian::Util::TimeSpan.inside?(open, close, '3pm')) + assert(! Custodian::Util::TimeSpan.inside?(open, close, '7pm')) # # Random hours should be outside too. # - assert( ! Custodian::Util::TimeSpan.inside?( open, close, 3 ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, '3am' ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, 7 ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, '7am' ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, 9 ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, '9am' ) ) + assert(! Custodian::Util::TimeSpan.inside?(open, close, 3)) + assert(! Custodian::Util::TimeSpan.inside?(open, close, '3am')) + assert(! Custodian::Util::TimeSpan.inside?(open, close, 7)) + assert(! Custodian::Util::TimeSpan.inside?(open, close, '7am')) + assert(! Custodian::Util::TimeSpan.inside?(open, close, 9)) + assert(! Custodian::Util::TimeSpan.inside?(open, close, '9am')) end @@ -202,7 +202,7 @@ class TestTimeSpanUtil < Test::Unit::TestCase # def test_worst for i in 0..23 - assert( Custodian::Util::TimeSpan.inside?( 0, 23, i ) ) + assert(Custodian::Util::TimeSpan.inside?(0, 23, i)) end end @@ -215,14 +215,14 @@ class TestTimeSpanUtil < Test::Unit::TestCase def test_wrap_around for h in 00..23 - assert_equal( 1, Custodian::Util::TimeSpan.to_hours( h,h ).size ) + assert_equal(1, Custodian::Util::TimeSpan.to_hours(h,h).size) end # # But the time-period 00-23 is a full day # - assert_equal( 24, - Custodian::Util::TimeSpan.to_hours( 0,23 ).size ) + assert_equal(24, + Custodian::Util::TimeSpan.to_hours(0,23).size) end diff --git a/t/test-http-vs-https.rb b/t/test-http-vs-https.rb index ab44ffc..8843683 100755 --- a/t/test-http-vs-https.rb +++ b/t/test-http-vs-https.rb @@ -42,13 +42,13 @@ class TestTestName < Test::Unit::TestCase test = nil assert_nothing_raised do - test = Custodian::TestFactory.create( 'http://example.com/ must run http.' ) + test = Custodian::TestFactory.create('http://example.com/ must run http.') end - assert( test ) - assert( test.kind_of? Array ) - assert( ! test.empty? ) - assert_equal( test[0].get_type, 'http' ) + assert(test) + assert(test.kind_of? Array) + assert(! test.empty?) + assert_equal(test[0].get_type, 'http') end @@ -59,13 +59,13 @@ class TestTestName < Test::Unit::TestCase test = nil assert_nothing_raised do - test = Custodian::TestFactory.create( 'https://example.com/ must run https.' ) + test = Custodian::TestFactory.create('https://example.com/ must run https.') end - assert( test ) - assert( test.kind_of? Array ) - assert( ! test.empty? ) - assert_equal( test[0].get_type, 'https' ) + assert(test) + assert(test.kind_of? Array) + assert(! test.empty?) + assert_equal(test[0].get_type, 'https') end @@ -76,19 +76,19 @@ class TestTestName < Test::Unit::TestCase assert_raise ArgumentError do - Custodian::TestFactory.create( 'https://example.com/ must run http.' ) + Custodian::TestFactory.create('https://example.com/ must run http.') end assert_raise ArgumentError do - Custodian::TestFactory.create( 'http://example.com/ must run https.' ) + Custodian::TestFactory.create('http://example.com/ must run https.') end assert_nothing_raised do - Custodian::TestFactory.create( 'http://example.com/ must run http.' ) + Custodian::TestFactory.create('http://example.com/ must run http.') end assert_nothing_raised do - Custodian::TestFactory.create( 'https://example.com/ must run https.' ) + Custodian::TestFactory.create('https://example.com/ must run https.') end end diff --git a/t/test-ldap-probe.rb b/t/test-ldap-probe.rb index 63e95a3..70b616b 100755 --- a/t/test-ldap-probe.rb +++ b/t/test-ldap-probe.rb @@ -29,12 +29,12 @@ class TestLDAPProbe < Test::Unit::TestCase test = nil assert_nothing_raised do - test = Custodian::TestFactory.create( "auth.bytemark.co.uk must run ldap on 389 with username 'testing' with password 'bob' otherwise 'LDAP dead?'." ) + test = Custodian::TestFactory.create("auth.bytemark.co.uk must run ldap on 389 with username 'testing' with password 'bob' otherwise 'LDAP dead?'.") end - assert( test.kind_of? Array ) - assert( ! test.empty? ) - assert_equal( test[0].get_type, 'ldap' ) + assert(test.kind_of? Array) + assert(! test.empty?) + assert_equal(test[0].get_type, 'ldap') end @@ -57,10 +57,10 @@ class TestLDAPProbe < Test::Unit::TestCase # data.each do |str| assert_raise ArgumentError do - test = Custodian::TestFactory.create( str ) + test = Custodian::TestFactory.create(str) - assert( test.kind_of? Array ) - assert( ! test.empty? ) + assert(test.kind_of? Array) + assert(! test.empty?) end end -- cgit v1.2.1