diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-02 09:08:14 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-02 09:08:14 +0000 |
commit | ff47ba9adb39976723752abfd6fbb72d7a55eaf1 (patch) | |
tree | 50c43355103eef0597958b3443694128604424ed /activesupport/test/core_ext | |
parent | e21c48baf7a021a5c65004977f9359bc301aac9d (diff) | |
download | rails-ff47ba9adb39976723752abfd6fbb72d7a55eaf1.tar.gz rails-ff47ba9adb39976723752abfd6fbb72d7a55eaf1.tar.bz2 rails-ff47ba9adb39976723752abfd6fbb72d7a55eaf1.zip |
Ruby 1.9 compat: add #raise to AS::BasicObject, fixup Duration argument error. Closes #10594.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8523 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/duration_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb index 125232bd40..2a86a7b1e7 100644 --- a/activesupport/test/core_ext/duration_test.rb +++ b/activesupport/test/core_ext/duration_test.rb @@ -18,4 +18,15 @@ class DurationTest < Test::Unit::TestCase def test_plus_with_time assert_equal 1 + 1.second, 1.second + 1, "Duration + Numeric should == Numeric + Duration" end + + def test_argument_error + begin + 1.second.ago('') + flunk("no exception was raised") + rescue ArgumentError => e + assert_equal 'expected a time or date, got ""', e.message, "ensure ArgumentError is not being raised by dependencies.rb" + rescue Exception + flunk("ArgumentError should be raised, but we got #{$!.class} instead") + end + end end |