aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/duration_test.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-06-03 13:32:53 -0500
committerJoshua Peek <josh@joshpeek.com>2008-06-03 13:32:53 -0500
commitc08547d2266c75f0a82d06dd91c6d0500740e12e (patch)
treeafd294792deab652137c1d172e752882bbd91669 /activesupport/test/core_ext/duration_test.rb
parentda91450e687fe9faa7b0575062c2b2aacc261f68 (diff)
downloadrails-c08547d2266c75f0a82d06dd91c6d0500740e12e.tar.gz
rails-c08547d2266c75f0a82d06dd91c6d0500740e12e.tar.bz2
rails-c08547d2266c75f0a82d06dd91c6d0500740e12e.zip
Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ActiveSupport [#238 state:resolved]
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