diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-08 11:54:18 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-05-08 11:54:18 +0100 |
commit | 8e6d4162ed7ca52598abf78f10317be0d77518a9 (patch) | |
tree | 4077f1c22bd277ff2fc3048148052cefccd576b0 | |
parent | deb14e7bc1979343188a0130d34bef16256e17ca (diff) |
Fixed time tests + standardised dead zone + daylight hours.
-rw-r--r-- | lib/mauve/configuration.rb | 6 | ||||
-rw-r--r-- | lib/mauve/mauve_time.rb | 4 | ||||
-rw-r--r-- | test/tc_mauve_time.rb | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/mauve/configuration.rb b/lib/mauve/configuration.rb index 2acbc42..457fb4d 100644 --- a/lib/mauve/configuration.rb +++ b/lib/mauve/configuration.rb @@ -77,9 +77,9 @@ module Mauve # # Working hours # - self.dead_zone = 3...6 - self.daytime_hours = 8...20 - self.working_hours = 9.5..17.5 + self.dead_zone = 3.0...7.0 + self.daytime_hours = 8.0...22.0 + self.working_hours = 9.5...17.5 end # Set the calendar URL. diff --git a/lib/mauve/mauve_time.rb b/lib/mauve/mauve_time.rb index c12fba3..2b9a0f0 100644 --- a/lib/mauve/mauve_time.rb +++ b/lib/mauve/mauve_time.rb @@ -122,7 +122,7 @@ class Time # From our SLA: # "Working hours" means 9.30am to 5.30pm, Monday to Friday, excluding # English bank holidays. - [9.5..17.5] + [9.5...17.5] end end @@ -138,7 +138,7 @@ class Time if defined? Mauve::Configuration and Mauve::Configuration.current Mauve::Configuration.current.daytime_hours else - [8.0...20.0] + [8.0...22.0] end end diff --git a/test/tc_mauve_time.rb b/test/tc_mauve_time.rb index 66cb4f7..96f789a 100644 --- a/test/tc_mauve_time.rb +++ b/test/tc_mauve_time.rb @@ -9,15 +9,15 @@ class TestMauveTime < Mauve::UnitTest def test_in_x_hours # - # 5pm on a Friday + # 5:44pm on a Friday # - t = Time.local(2011,6,3,17,14,32) + t = Time.local(2011,6,3,17,44,32) # # Working hours.. # - hour_0 = Time.local(2011,6,6,9,0,0) - hour_1 = Time.local(2011,6,6,10,0,0) + hour_0 = Time.local(2011,6,6,9,30,0) + hour_1 = Time.local(2011,6,6,10,30,0) assert_equal(hour_1, t.in_x_hours(1,"working")) assert_equal(hour_0, t.in_x_hours(0,"working")) |