From a22b8e96ead33b0f97ed5243dbad7f7b6cd5135d Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 9 Mar 2015 13:19:15 +0000 Subject: Prefer single-quotes when you don't need interpolation. So "foo" is less good than 'foo'. --- t/test-custodian-alertfactory.rb | 14 +++---- t/test-custodian-parser.rb | 50 +++++++++++------------ t/test-custodian-queue.rb | 6 +-- t/test-custodian-settings.rb | 8 ++-- t/test-custodian-testfactory.rb | 84 +++++++++++++++++++-------------------- t/test-custodian-util-bytemark.rb | 10 ++--- t/test-custodian-util-dns.rb | 28 ++++++------- t/test-custodian-util-ping.rb | 6 +-- t/test-custodian-util-timespan.rb | 40 +++++++++---------- t/test-http-vs-https.rb | 16 ++++---- t/test-ldap-probe.rb | 4 +- t/test-suite | 2 +- 12 files changed, 134 insertions(+), 134 deletions(-) (limited to 't') diff --git a/t/test-custodian-alertfactory.rb b/t/test-custodian-alertfactory.rb index 42873ec..eea35ac 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,8 +54,8 @@ 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| @@ -75,8 +75,8 @@ class TestAlertFactory < Test::Unit::TestCase # 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,7 +84,7 @@ 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 # diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index 49416b3..bbdb8ad 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -51,7 +51,7 @@ 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" ) + result = parser.parse_line( 'example.vm.bytemark.co.uk must run ping except between 00-23' ) assert( result.nil? ) end @@ -72,7 +72,7 @@ class TestCustodianParser < Test::Unit::TestCase parser = Custodian::Parser.new # 1.a. Comment lines return nil. - result = parser.parse_line( "# this is a comment" ) + result = parser.parse_line( '# this is a comment' ) assert( result.nil? ) # 1.b. Non-strings are an error @@ -94,7 +94,7 @@ class TestCustodianParser < Test::Unit::TestCase parser = Custodian::Parser.new # 2.a. Comment lines return nil. tmp = [] - tmp.push( "# This is a comment.." ) + tmp.push( '# This is a comment..' ) assert( parser.parse_lines( tmp ).nil? ) # 2.b. Adding a test will return an array of test-objects. @@ -172,8 +172,8 @@ EOF # Input text # text = [] - text.push( "FOO is kvm1.vm.bytemark.co.uk." ) - text.push( "FOO2 is kvm2.vm.bytemark.co.uk." ) + text.push( 'FOO is kvm1.vm.bytemark.co.uk.' ) + text.push( 'FOO2 is kvm2.vm.bytemark.co.uk.' ) # # Test the parser with this text @@ -203,8 +203,8 @@ EOF # Input text to parse. # text = [] - text.push( "FOO is kvm1.vm.bytemark.co.uk." ) - text.push( "FOO is kvm2.vm.bytemark.co.uk." ) + text.push( 'FOO is kvm1.vm.bytemark.co.uk.' ) + text.push( 'FOO is kvm2.vm.bytemark.co.uk.' ) # # Test the parser with this text @@ -241,7 +241,7 @@ EOF # Expand a line - which should result in no change # as the line does not involve a known-macro # - in_txt = "example.bytemark.co.uk must run smtp." + in_txt = 'example.bytemark.co.uk must run smtp.' out_txt = parser.expand_macro( in_txt ) # @@ -255,14 +255,14 @@ EOF # # Now define a macro # - parser.parse_line( "TARGET is example1.bytemark.co.uk and example2.bytemark.co.uk." ) + parser.parse_line( 'TARGET is example1.bytemark.co.uk and example2.bytemark.co.uk.' ) macros = parser.macros assert( !macros.empty? ) # # Now we have a two-host macro, repeat the expansion # - ret = parser.expand_macro( "TARGET must run smtp on 25." ) + ret = parser.expand_macro( 'TARGET must run smtp on 25.' ) # # The result should be an array @@ -284,12 +284,12 @@ EOF # test data # data = { - "http://example must run http." => true, - "http://example must run http with status 200." => true, + 'http://example must run http.' => true, + 'http://example must run http with status 200.' => true, "http://example must run http with content 'bar'." => true, - "http://example must run http following redirects." => true, - "http://example must run http not following redirects." => false, - "http://example must run http not following redirect." => false, + 'http://example must run http following redirects.' => true, + 'http://example must run http not following redirects.' => false, + 'http://example must run http not following redirect.' => false, } data.each do |str,follow| @@ -325,10 +325,10 @@ EOF # test data # data = { - "http://example must run http." => true, - "http://example must run http with status 200." => true, + 'http://example must run http.' => true, + 'http://example must run http with status 200.' => true, "http://example must run http with content 'bar'." => true, - "http://example must run http without cache busting." => false, + 'http://example must run http without cache busting.' => false, } data.each do |str,cb| @@ -365,13 +365,13 @@ EOF # test data # data = { - "foo must run rsync." => nil, - "foo must run redis." => nil, - "foo must not run ping." => nil, - "foo must not run ssh otherwise 'fail'" => "fail", - "foo must not run ssh otherwise 'fail'." => "fail", - "foo must run redis otherwise 'memorystorage service is dead'" => "memorystorage service is dead", - "foo must run ping otherwise 'don't you love me?'" => "don" + 'foo must run rsync.' => nil, + 'foo must run redis.' => nil, + 'foo must not run ping.' => nil, + "foo must not run ssh otherwise 'fail'" => 'fail', + "foo must not run ssh otherwise 'fail'." => 'fail', + "foo must run redis otherwise 'memorystorage service is dead'" => 'memorystorage service is dead', + "foo must run ping otherwise 'don't you love me?'" => 'don' } # diff --git a/t/test-custodian-queue.rb b/t/test-custodian-queue.rb index 0170ef1..bec83e2 100755 --- a/t/test-custodian-queue.rb +++ b/t/test-custodian-queue.rb @@ -40,7 +40,7 @@ class TestCustodianQueue < Test::Unit::TestCase # creation will fail assert_raise RuntimeError do - t = Custodian::QueueType.create( "foo" ) + t = Custodian::QueueType.create( 'foo' ) end end @@ -50,7 +50,7 @@ class TestCustodianQueue < Test::Unit::TestCase def test_redis q = nil assert_nothing_raised do - q = Custodian::QueueType.create( "redis" ) + q = Custodian::QueueType.create( 'redis' ) end # @@ -68,7 +68,7 @@ class TestCustodianQueue < Test::Unit::TestCase def test_beanstalkd q = nil assert_nothing_raised do - q = Custodian::QueueType.create( "redis" ) + q = Custodian::QueueType.create( 'redis' ) end # diff --git a/t/test-custodian-settings.rb b/t/test-custodian-settings.rb index 0347e7c..1923b0f 100755 --- a/t/test-custodian-settings.rb +++ b/t/test-custodian-settings.rb @@ -50,13 +50,13 @@ class TestConfigurationSingleton < Test::Unit::TestCase assert( a.class == Fixnum ) # store a number - settings._store( "retry_delay", 5 ) + settings._store( 'retry_delay', 5 ) a = settings.retry_delay assert( a.class == Fixnum ) assert( a == 5 ) # store a string - settings._store( "retry_delay", "35" ) + settings._store( 'retry_delay', '35' ) a = settings.retry_delay assert( a.class == Fixnum ) assert( a == 35 ) @@ -68,13 +68,13 @@ class TestConfigurationSingleton < Test::Unit::TestCase assert( a.class == Fixnum ) # store a number - settings._store( "timeout", 5 ) + settings._store( 'timeout', 5 ) a = settings.timeout assert( a.class == Fixnum ) assert( a == 5 ) # store a string - settings._store( "timeout", "35" ) + settings._store( 'timeout', '35' ) a = settings.timeout assert( a.class == Fixnum ) assert( a == 35 ) diff --git a/t/test-custodian-testfactory.rb b/t/test-custodian-testfactory.rb index b067ab8..af3e3b3 100755 --- a/t/test-custodian-testfactory.rb +++ b/t/test-custodian-testfactory.rb @@ -45,25 +45,25 @@ class TestTestFactory < Test::Unit::TestCase def test_ftp_uri assert_nothing_raised do - assert( Custodian::TestFactory.create( "ftp.example.com must run ftp." ) ) - assert( Custodian::TestFactory.create( "ftp://ftp.example.com/ must run ftp." ) ) - assert( Custodian::TestFactory.create( "ftp://ftp.example.com/ must run ftp on 21." ) ) + assert( Custodian::TestFactory.create( 'ftp.example.com must run ftp.' ) ) + assert( Custodian::TestFactory.create( 'ftp://ftp.example.com/ must run ftp.' ) ) + assert( Custodian::TestFactory.create( 'ftp://ftp.example.com/ must run ftp on 21.' ) ) assert( Custodian::TestFactory.create( "ftp://ftp.example.com/ must run ftp on 21 otherwise 'xxx'." ) ) end - assert( Custodian::TestFactory.create( "ftp.example.com must run ftp." )[0].target == "ftp.example.com" ) - assert( Custodian::TestFactory.create( "ftp://ftp.example.com/ must run ftp." )[0].target == "ftp.example.com" ) + assert( Custodian::TestFactory.create( 'ftp.example.com must run ftp.' )[0].target == 'ftp.example.com' ) + assert( Custodian::TestFactory.create( 'ftp://ftp.example.com/ must run ftp.' )[0].target == 'ftp.example.com' ) # # Test the port detection # data = { - "foo must run ftp." => "21", - "ftp://ftp.example.com/ must run ftp." => "21", - "foo must run ftp on 1 otherwise 'x'." => "1", - "foo must run ftp on 33 otherwise" => "33", + 'foo must run ftp.' => '21', + 'ftp://ftp.example.com/ must run ftp.' => '21', + "foo must run ftp on 1 otherwise 'x'." => '1', + 'foo must run ftp on 33 otherwise' => '33', } # @@ -76,7 +76,7 @@ class TestTestFactory < Test::Unit::TestCase assert( obj.kind_of? Array ) assert( ! obj.empty? ) - assert_equal( obj[0].get_type, "ftp" ) + assert_equal( obj[0].get_type, 'ftp' ) assert_equal( obj[0].port.to_s, prt ) end @@ -91,11 +91,11 @@ class TestTestFactory < Test::Unit::TestCase # def test_port_detection data = { - "foo must run ftp." => "21", - "foo must run ssh." => "22", - "foo must run mysql otherwise 'alert'" => "3306", - "foo must run redis otherwise 'alert'" => "6379", - "foo must run mysql on 33 otherwise 'alert'" => "33", + 'foo must run ftp.' => '21', + 'foo must run ssh.' => '22', + "foo must run mysql otherwise 'alert'" => '3306', + "foo must run redis otherwise 'alert'" => '6379', + "foo must run mysql on 33 otherwise 'alert'" => '33', } # @@ -124,26 +124,26 @@ class TestTestFactory < Test::Unit::TestCase assert_nothing_raised do - assert( Custodian::TestFactory.create( "example.com must run rsync." ) ) - assert( Custodian::TestFactory.create( "ftp://example.com/ must run rsync." ) ) - assert( Custodian::TestFactory.create( "ftp://example.com/ must run rsync on 333." ) ) + assert( Custodian::TestFactory.create( 'example.com must run rsync.' ) ) + assert( Custodian::TestFactory.create( 'ftp://example.com/ must run rsync.' ) ) + assert( Custodian::TestFactory.create( 'ftp://example.com/ must run rsync on 333.' ) ) assert( Custodian::TestFactory.create( "ftp://example.com/ must run rsync on 3311 otherwise 'xxx'." ) ) end - assert( Custodian::TestFactory.create( "rsync.example.com must run rsync." )[0].target == - "rsync.example.com" ) - assert( Custodian::TestFactory.create( "rsync://rsync.example.com/ must run rsync." )[0].target == - "rsync.example.com" ) + assert( Custodian::TestFactory.create( 'rsync.example.com must run rsync.' )[0].target == + 'rsync.example.com' ) + assert( Custodian::TestFactory.create( 'rsync://rsync.example.com/ must run rsync.' )[0].target == + 'rsync.example.com' ) # # Test the ports # data = { - "foo must run rsync." => "873", - "rsync://foo/ must run rsync." => "873", - "foo must run rsync on 1 otherwise 'x'." => "1", - "foo must run rsync on 33 otherwise" => "33", + 'foo must run rsync.' => '873', + 'rsync://foo/ must run rsync.' => '873', + "foo must run rsync on 1 otherwise 'x'." => '1', + 'foo must run rsync on 33 otherwise' => '33', } # @@ -191,7 +191,7 @@ class TestTestFactory < Test::Unit::TestCase # Missing expected results # assert_raise ArgumentError do - assert( Custodian::TestFactory.create( "a.ns.bytemark.co.uk must run dns for www.bytemark.co.uk resolving NS " ) ) + assert( Custodian::TestFactory.create( 'a.ns.bytemark.co.uk must run dns for www.bytemark.co.uk resolving NS ' ) ) end end @@ -205,9 +205,9 @@ class TestTestFactory < Test::Unit::TestCase assert_nothing_raised do - assert( Custodian::TestFactory.create( "example.com must not run rsync." ) ) - assert( Custodian::TestFactory.create( "ftp://example.com/ must not run rsync." ) ) - assert( Custodian::TestFactory.create( "ftp://example.com/ must not run rsync on 333." ) ) + assert( Custodian::TestFactory.create( 'example.com must not run rsync.' ) ) + assert( Custodian::TestFactory.create( 'ftp://example.com/ must not run rsync.' ) ) + assert( Custodian::TestFactory.create( 'ftp://example.com/ must not run rsync on 333.' ) ) end @@ -215,11 +215,11 @@ class TestTestFactory < Test::Unit::TestCase # Test some inversions # data = { - "foo must run rsync." => false, - "rsync://foo/ must run rsync." => false, - "foo must run ping otherwise" => false, - "foo must not run ping otherwise" => true, - "foo must not run ssh otherwise" => true, + 'foo must run rsync.' => false, + 'rsync://foo/ must run rsync.' => false, + 'foo must run ping otherwise' => false, + 'foo must not run ping otherwise' => true, + 'foo must not run ssh otherwise' => true, } # @@ -292,13 +292,13 @@ 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 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( '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 @@ -306,7 +306,7 @@ class TestTestFactory < Test::Unit::TestCase assert(obj) assert( obj.kind_of? Array ) assert( ! obj.empty? ) - assert_equal( "test.host.example.com", obj[0].target ) + 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 9296dcb..30bb480 100755 --- a/t/test-custodian-util-bytemark.rb +++ b/t/test-custodian-util-bytemark.rb @@ -38,15 +38,15 @@ class TestBytemarkUtil < Test::Unit::TestCase # # Hosts inside the Bytemark network # - "80.68.85.48" => true, - "2001:41c8:125:46::10" => true, + '80.68.85.48' => true, + '2001:41c8:125:46::10' => true, # # Hosts outside the Bytemark network # - "127.0.0.1" => false, - "192.168.1.1" => false, - "2a00:1450:400c:c00::93" => false, + '127.0.0.1' => false, + '192.168.1.1' => false, + '2a00:1450:400c:c00::93' => false, } diff --git a/t/test-custodian-util-dns.rb b/t/test-custodian-util-dns.rb index f226efe..2582d94 100755 --- a/t/test-custodian-util-dns.rb +++ b/t/test-custodian-util-dns.rb @@ -30,26 +30,26 @@ 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" ) + details = Custodian::Util::DNS.hostname_to_ip( 'this.doesnot.exist' ) assert( details.nil? ) end @@ -63,19 +63,19 @@ class TestDNSUtil < Test::Unit::TestCase # # IPv6 lookup # - details = Custodian::Util::DNS.ip_to_hostname( "2001:41c9:0:1019:81::80" ) + 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" ) + 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" ) + details = Custodian::Util::DNS.ip_to_hostname( '800.683.853.348' ) assert( details.nil? ) end diff --git a/t/test-custodian-util-ping.rb b/t/test-custodian-util-ping.rb index bf8ac43..e01ef8d 100755 --- a/t/test-custodian-util-ping.rb +++ b/t/test-custodian-util-ping.rb @@ -34,7 +34,7 @@ class TestPingUtil < Test::Unit::TestCase # Normal construction works. # assert_nothing_raised do - Custodian::Util::Ping.new("foo") + Custodian::Util::Ping.new('foo') end # @@ -64,7 +64,7 @@ class TestPingUtil < Test::Unit::TestCase # def test_lookup_ipv4 - helper = Custodian::Util::Ping.new( "ipv4.steve.org.uk" ) + helper = Custodian::Util::Ping.new( 'ipv4.steve.org.uk' ) assert( helper.is_ipv4? ) assert( ! helper.is_ipv6? ) @@ -76,7 +76,7 @@ class TestPingUtil < Test::Unit::TestCase # def test_lookup_ipv6 - helper = Custodian::Util::Ping.new( "ipv6.steve.org.uk" ) + helper = Custodian::Util::Ping.new( 'ipv6.steve.org.uk' ) assert( helper.is_ipv6? ) assert( ! helper.is_ipv4? ) end diff --git a/t/test-custodian-util-timespan.rb b/t/test-custodian-util-timespan.rb index 29e9b83..210a532 100755 --- a/t/test-custodian-util-timespan.rb +++ b/t/test-custodian-util-timespan.rb @@ -114,7 +114,7 @@ class TestTimeSpanUtil < Test::Unit::TestCase # def test_simple_cases # 8am-5pm - assert(Custodian::Util::TimeSpan.inside?( "8am", "5am", 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?( '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?( 21, 2, '10pm' )) # 10pm-3am - assert(Custodian::Util::TimeSpan.inside?( "10pm", "3am", 22 )) + 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?( 22, 3, '10pm' )) # 11pm-5am - assert(Custodian::Util::TimeSpan.inside?( "11pm", "5am", 23 )) + 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', '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 @@ -154,18 +154,18 @@ class TestTimeSpanUtil < Test::Unit::TestCase # def test_inclusive - open = "4pm" - close = "6pm" + open = '4pm' + 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, '4pm' ) ) assert( Custodian::Util::TimeSpan.inside?( open, close, 17 ) ) - assert( Custodian::Util::TimeSpan.inside?( open, close, "5pm" ) ) + 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, '6pm' ) ) # @@ -177,19 +177,19 @@ class TestTimeSpanUtil < Test::Unit::TestCase # # 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, '3am' ) ) assert( ! Custodian::Util::TimeSpan.inside?( open, close, 7 ) ) - assert( ! Custodian::Util::TimeSpan.inside?( open, close, "7am" ) ) + 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, '9am' ) ) end diff --git a/t/test-http-vs-https.rb b/t/test-http-vs-https.rb index b320777..ab44ffc 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_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_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 5273b31..63e95a3 100755 --- a/t/test-ldap-probe.rb +++ b/t/test-ldap-probe.rb @@ -34,7 +34,7 @@ class TestLDAPProbe < Test::Unit::TestCase assert( test.kind_of? Array ) assert( ! test.empty? ) - assert_equal( test[0].get_type, "ldap" ) + assert_equal( test[0].get_type, 'ldap' ) end @@ -47,7 +47,7 @@ class TestLDAPProbe < Test::Unit::TestCase # test data # data = [ - "foo.example.com must run ldap on 389.", + 'foo.example.com must run ldap on 389.', "foo.example.com must run ldap with username 'test'.", "foo.example.com must run ldap with uername 'test' with password 'x'." ] diff --git a/t/test-suite b/t/test-suite index 02df298..26ddb1f 100755 --- a/t/test-suite +++ b/t/test-suite @@ -27,7 +27,7 @@ dir = File.dirname(__FILE__) # # Load each file in the same directory. # -Dir.glob(File.join(dir,"t*.rb")).each do |test| +Dir.glob(File.join(dir,'t*.rb')).each do |test| require test end -- cgit v1.2.1