Permalink
Browse files

Wrap date part value method tests inside a uses mocha block.

  • Loading branch information...
1 parent ea1c1f2 commit 88ff9e1098312d5b12d64cb323f2642f7735c49b @josh josh committed with jeremy Jun 8, 2008
Showing with 18 additions and 16 deletions.
  1. +18 −16 activesupport/test/core_ext/time_with_zone_test.rb
View
34 activesupport/test/core_ext/time_with_zone_test.rb
@@ -342,24 +342,26 @@ def test_marshal_dump_and_load_with_tzinfo_identifier
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

0 comments on commit 88ff9e1

Please sign in to comment.