diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:19:15 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:19:15 +0000 |
commit | a22b8e96ead33b0f97ed5243dbad7f7b6cd5135d (patch) | |
tree | 3fe30365cc9d793c752653a59614b52009ef9336 /t/test-custodian-util-timespan.rb | |
parent | 7782df6020704f51ee2d6194d8d3b74f28a53401 (diff) |
Prefer single-quotes when you don't need interpolation.
So "foo" is less good than 'foo'.
Diffstat (limited to 't/test-custodian-util-timespan.rb')
-rwxr-xr-x | t/test-custodian-util-timespan.rb | 40 |
1 files changed, 20 insertions, 20 deletions
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 |