Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make stubbing Time.now easier

  • Loading branch information...
commit 0ae5807fa34a625d0d9932242ea121f6f7cdbf20 1 parent 8d87d5c
@tenderlove tenderlove authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 activesupport/lib/active_support/values/time_zone.rb
View
8 activesupport/lib/active_support/values/time_zone.rb
@@ -282,7 +282,7 @@ def parse(str, now=now)
# Time.zone = 'Hawaii' # => "Hawaii"
# Time.zone.now # => Wed, 23 Jan 2008 20:24:27 HST -10:00
def now
- Time.now.utc.in_time_zone(self)
+ time_now.utc.in_time_zone(self)
end
# Return the current date in this time zone.
@@ -391,5 +391,11 @@ def lazy_zones_map
end
end
end
+
+ private
+
+ def time_now
+ Time.now
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.