Changeset 8523
- Timestamp:
- 01/02/08 09:08:14 (8 months ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/basic_object.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/duration.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/duration_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r8518 r8523 7 7 * Hash#symbolize_keys skips keys that can't be symbolized. #10500 [Brad Greenlee] 8 8 9 * Ruby 1.9 compatibility. #1689, #10466, #10468, #10554, #10 632 [Cheah Chu Yeow, Pratik Naik, Jeremy Kemper, Dirkjan Bussink]9 * Ruby 1.9 compatibility. #1689, #10466, #10468, #10554, #10594, #10632 [Cheah Chu Yeow, Pratik Naik, Jeremy Kemper, Dirkjan Bussink, fxn] 10 10 11 11 * TimeZone#to_s uses UTC rather than GMT. #1689 [Cheah Chu Yeow] trunk/activesupport/lib/active_support/basic_object.rb
r8500 r8523 7 7 undef_method :== 8 8 undef_method :equal? 9 10 # Let ActiveSupport::BasicObject at least raise exceptions. 11 def raise(*args) 12 ::Object.send(:raise, *args) 13 end 9 14 end 10 15 else trunk/activesupport/lib/active_support/duration.rb
r8412 r8523 83 83 end 84 84 else 85 raise ArgumentError, "expected a time or date, got #{time.inspect}"85 raise ::ArgumentError, "expected a time or date, got #{time.inspect}" 86 86 end 87 87 end trunk/activesupport/test/core_ext/duration_test.rb
r8399 r8523 19 19 assert_equal 1 + 1.second, 1.second + 1, "Duration + Numeric should == Numeric + Duration" 20 20 end 21 22 def test_argument_error 23 begin 24 1.second.ago('') 25 flunk("no exception was raised") 26 rescue ArgumentError => e 27 assert_equal 'expected a time or date, got ""', e.message, "ensure ArgumentError is not being raised by dependencies.rb" 28 rescue Exception 29 flunk("ArgumentError should be raised, but we got #{$!.class} instead") 30 end 31 end 21 32 end