aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/notification.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-18 18:19:40 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-18 18:19:40 +0100
commite75e185bd348fd21fb62ba77f54d4f27755ba747 (patch)
treea53d73607739d0bf66030f64d1f77b687668645c /lib/mauve/notification.rb
parent6aba0c3d8e2d30797755dc8b968fe338e13b8df4 (diff)
Fixed up test_time bits in mauve_notification and merged tests.
Diffstat (limited to 'lib/mauve/notification.rb')
-rw-r--r--lib/mauve/notification.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/mauve/notification.rb b/lib/mauve/notification.rb
index 8e125be..c57d2a9 100644
--- a/lib/mauve/notification.rb
+++ b/lib/mauve/notification.rb
@@ -87,10 +87,12 @@ module Mauve
protected
def hours_in_day(*hours)
+ @test_time = @time if @test_time.nil?
x_in_list_of_y(@test_time.hour, hours.flatten)
end
def days_in_week(*days)
+ @test_time = @time if @test_time.nil?
x_in_list_of_y(@test_time.wday, days.flatten)
end
@@ -114,6 +116,7 @@ module Mauve
end
def working_hours?
+ @test_time = @time if @test_time.nil?
@test_time.working_hours?
end
@@ -123,6 +126,7 @@ module Mauve
#
# @return [Boolean] Whether now is a in the dead zone or not.
def dead_zone?
+ @test_time = @time if @test_time.nil?
@test_time.dead_zone?
end