From 891b720013f06f092f6be82adad95e5551c696b6 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Mon, 9 Mar 2015 13:09:46 +0000 Subject: Do not use parentheses for method calls with no arguments. This is neater. Flagged by rubocop --- t/test-custodian-parser.rb | 32 ++++++++++++++++---------------- t/test-custodian-settings.rb | 12 ++++++------ t/test-custodian-testfactory.rb | 24 ++++++++++++------------ t/test-custodian-util-timespan.rb | 4 ++-- 4 files changed, 36 insertions(+), 36 deletions(-) (limited to 't') diff --git a/t/test-custodian-parser.rb b/t/test-custodian-parser.rb index 5822ecd..43a0754 100755 --- a/t/test-custodian-parser.rb +++ b/t/test-custodian-parser.rb @@ -44,13 +44,13 @@ class TestCustodianParser < Test::Unit::TestCase # Constructor # assert_nothing_raised do - Custodian::Parser.new() + Custodian::Parser.new end end def test_period - parser = Custodian::Parser.new() + parser = Custodian::Parser.new result = parser.parse_line( "example.vm.bytemark.co.uk must run ping except between 00-23" ) assert( result.nil? ) end @@ -69,7 +69,7 @@ class TestCustodianParser < Test::Unit::TestCase # # 1. By string. # - parser = Custodian::Parser.new() + parser = Custodian::Parser.new # 1.a. Comment lines return nil. result = parser.parse_line( "# this is a comment" ) @@ -91,7 +91,7 @@ class TestCustodianParser < Test::Unit::TestCase # # 2. By array. # - parser = Custodian::Parser.new() + parser = Custodian::Parser.new # 2.a. Comment lines return nil. tmp = [] tmp.push( "# This is a comment.." ) @@ -107,7 +107,7 @@ class TestCustodianParser < Test::Unit::TestCase # # 3. By lines # - parser = Custodian::Parser.new() + parser = Custodian::Parser.new # 3.a. Comment lines return nil. str =< #{inv}" ) + assert( obj[0].inverted == inv, "#{str} -> #{inv}" ) end end @@ -247,7 +247,7 @@ class TestTestFactory < Test::Unit::TestCase # Get all the types we know about. # def test_types - registered = Custodian::TestFactory.known_tests() + registered = Custodian::TestFactory.known_tests # for each test-type registered.keys.each do |type| @@ -270,10 +270,10 @@ class TestTestFactory < Test::Unit::TestCase assert_nothing_raised do test_one_obj = Custodian::TestFactory.create( test_one ) - assert( !test_one_obj[0].inverted() ) + 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}" ) + 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 ) @@ -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-timespan.rb b/t/test-custodian-util-timespan.rb index ef05fe7..29e9b83 100755 --- a/t/test-custodian-util-timespan.rb +++ b/t/test-custodian-util-timespan.rb @@ -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() ) + Custodian::Util::TimeSpan.to_hours( 0,23 ).size ) end -- cgit v1.2.1