diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/duration_test.rb | 4 | ||||
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 4 |
2 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 b6456f0a30..bb453b8d7f 100644 --- a/activesupport/test/core_ext/duration_test.rb +++ b/activesupport/test/core_ext/duration_test.rb @@ -53,8 +53,8 @@ class DurationTest < ActiveSupport::TestCase 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") + rescue Exception => e + flunk("ArgumentError should be raised, but we got #{e.class} instead") end end diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index f47e896487..50778b5864 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -217,8 +217,8 @@ class OrderedHashTest < Test::Unit::TestCase ActiveSupport::OrderedHash[1,2,3,4,5] flunk "Hash::[] should have raised an exception on initialization " + "with an odd number of parameters" - rescue - assert_equal "odd number of arguments for Hash", $!.message + rescue ArgumentError => e + assert_equal "odd number of arguments for Hash", e.message end end |