Skip to content
This repository
Browse code

Merge pull request #6451 from chancancode/3-2-stable_restore_frozen_s…

…tate_on_rollback

Fixes the build break caused by 9ee8528 in #6445.
  • Loading branch information...
commit ff3cddf8763e100947cdffe9c25716e93ccbac62 2 parents 9ee8528 + d3715f6
Rafael Mendonça França authored May 22, 2012
6  activerecord/test/cases/transactions_test.rb
@@ -363,10 +363,12 @@ def test_rollback_when_commit_raises
363 363
   end
364 364
 
365 365
   def test_rollback_when_saving_a_frozen_record
  366
+    expected_raise = (RUBY_VERSION < '1.9') ? TypeError : RuntimeError
  367
+
366 368
     topic = Topic.new(:title => 'test')
367 369
     topic.freeze
368  
-    e = assert_raise(RuntimeError) { topic.save }
369  
-    assert_equal "can't modify frozen Hash", e.message
  370
+    e = assert_raise(expected_raise) { topic.save }
  371
+    assert_equal "can't modify frozen hash", e.message.downcase
370 372
     assert !topic.persisted?, 'not persisted'
371 373
     assert_nil topic.id
372 374
     assert topic.frozen?, 'not frozen'

0 notes on commit ff3cddf

Please sign in to comment.
Something went wrong with that request. Please try again.