diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-06-07 23:25:34 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-06-07 23:25:34 -0500 |
commit | ceb5b6dbb141888ae56788a3d40ccb7017c92f7d (patch) | |
tree | 3f549e40413d6e0613d856d8ced143ca90bd7cd5 | |
parent | 67e4f16fc5303ae35bdfe9ef4ef016127751ce35 (diff) | |
download | rails-ceb5b6dbb141888ae56788a3d40ccb7017c92f7d.tar.gz rails-ceb5b6dbb141888ae56788a3d40ccb7017c92f7d.tar.bz2 rails-ceb5b6dbb141888ae56788a3d40ccb7017c92f7d.zip |
Wrap date part value method tests inside a uses mocha block.
-rw-r--r-- | activesupport/test/core_ext/time_with_zone_test.rb | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb index 012ec373c9..0977cd8e50 100644 --- a/activesupport/test/core_ext/time_with_zone_test.rb +++ b/activesupport/test/core_ext/time_with_zone_test.rb @@ -336,24 +336,26 @@ class TimeWithZoneTest < Test::Unit::TestCase end end - def test_method_missing_with_non_time_return_value - silence_warnings do # silence warnings raised by tzinfo gem - @twz.time.expects(:foo).returns('bar') - assert_equal 'bar', @twz.foo + uses_mocha 'TestDatePartValueMethods' do + def test_method_missing_with_non_time_return_value + silence_warnings do # silence warnings raised by tzinfo gem + @twz.time.expects(:foo).returns('bar') + assert_equal 'bar', @twz.foo + end end - end - def test_date_part_value_methods - silence_warnings do # silence warnings raised by tzinfo gem - twz = ActiveSupport::TimeWithZone.new(Time.utc(1999,12,31,19,18,17,500), @time_zone) - twz.stubs(:method_missing).returns(nil) #ensure these methods are defined directly on class - assert_equal 1999, twz.year - assert_equal 12, twz.month - assert_equal 31, twz.day - assert_equal 14, twz.hour - assert_equal 18, twz.min - assert_equal 17, twz.sec - assert_equal 500, twz.usec + def test_date_part_value_methods + silence_warnings do # silence warnings raised by tzinfo gem + twz = ActiveSupport::TimeWithZone.new(Time.utc(1999,12,31,19,18,17,500), @time_zone) + twz.stubs(:method_missing).returns(nil) #ensure these methods are defined directly on class + assert_equal 1999, twz.year + assert_equal 12, twz.month + assert_equal 31, twz.day + assert_equal 14, twz.hour + assert_equal 18, twz.min + assert_equal 17, twz.sec + assert_equal 500, twz.usec + end end end |