From 28574961fb5a6cdc7cdf420e1e3694653619bb5b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 16 May 2013 13:33:35 -0700 Subject: [PATCH] test refactor --- activerecord/test/cases/attribute_methods_test.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index d882d40ecb..f10732ddda 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -712,12 +712,9 @@ class AttributeMethodsTest < ActiveRecord::TestCase end def test_bulk_update_raise_unknown_attribute_errro - error = nil - begin + error = assert_raises(ActiveRecord::UnknownAttributeError) { @target.new(:hello => "world") - rescue ActiveRecord::UnknownAttributeError => error - end - assert error + } assert @target, error.record assert "hello", error.attribute assert "unknown attribute: hello", error.message