aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/duration_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/core_ext/duration_test.rb')
-rw-r--r--activesupport/test/core_ext/duration_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb
index 7b17fe71db..f802ed8760 100644
--- a/activesupport/test/core_ext/duration_test.rb
+++ b/activesupport/test/core_ext/duration_test.rb
@@ -29,7 +29,7 @@ class DurationTest < Test::Unit::TestCase
flunk("ArgumentError should be raised, but we got #{$!.class} instead")
end
end
-
+
uses_mocha 'TestDurationSinceAndAgoWithCurrentTime' do
def test_since_and_ago_anchored_to_time_now_when_time_zone_default_not_set
Time.zone_default = nil
@@ -43,10 +43,10 @@ class DurationTest < Test::Unit::TestCase
assert_equal Time.local(1999,12,31,23,59,55), 5.seconds.ago
end
end
-
+
def test_since_and_ago_anchored_to_time_zone_now_when_time_zone_default_set
silence_warnings do # silence warnings raised by tzinfo gem
- Time.zone_default = TimeZone['Eastern Time (US & Canada)']
+ Time.zone_default = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
with_env_tz 'US/Eastern' do
Time.stubs(:now).returns Time.local(2000)
# since
@@ -63,7 +63,7 @@ class DurationTest < Test::Unit::TestCase
Time.zone_default = nil
end
end
-
+
protected
def with_env_tz(new_tz = 'US/Eastern')
old_tz, ENV['TZ'] = ENV['TZ'], new_tz