<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -233,7 +233,7 @@ module ActiveRecord
       method_name = method_id.to_s
 
       if self.class.private_method_defined?(method_name)
-        raise NoMethodError(&quot;Attempt to call private method&quot;, method_name, args)
+        raise NoMethodError.new(&quot;Attempt to call private method&quot;, method_name, args)
       end
 
       # If we haven't generated any methods yet, generate them, then</diff>
      <filename>activerecord/lib/active_record/attribute_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -233,8 +233,9 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
 
     topic = @target.new(:title =&gt; &quot;The pros and cons of programming naked.&quot;)
     assert !topic.respond_to?(:title)
-    assert_raise(NoMethodError) { topic.title }
-    topic.send(:title)
+    exception = assert_raise(NoMethodError) { topic.title }
+    assert_equal &quot;Attempt to call private method&quot;, exception.message
+    assert_equal &quot;I'm private&quot;, topic.send(:title)
   end
 
   def test_write_attributes_respect_access_control
@@ -242,7 +243,8 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
 
     topic = @target.new
     assert !topic.respond_to?(:title=)
-    assert_raise(NoMethodError) { topic.title = &quot;Pants&quot;}
+    exception = assert_raise(NoMethodError) { topic.title = &quot;Pants&quot;}
+    assert_equal &quot;Attempt to call private method&quot;, exception.message
     topic.send(:title=, &quot;Very large pants&quot;)
   end
 
@@ -251,7 +253,8 @@ class AttributeMethodsTest &lt; ActiveRecord::TestCase
 
     topic = @target.new(:title =&gt; &quot;Isaac Newton's pants&quot;)
     assert !topic.respond_to?(:title?)
-    assert_raise(NoMethodError) { topic.title? }
+    exception = assert_raise(NoMethodError) { topic.title? }
+    assert_equal &quot;Attempt to call private method&quot;, exception.message
     assert topic.send(:title?)
   end
 </diff>
      <filename>activerecord/test/cases/attribute_methods_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5cf932344a4482a0cfbda57e9f69ebe64e70a261</id>
    </parent>
  </parents>
  <author>
    <name>Mike Gunderloy</name>
    <login>ffmike</login>
    <email>MikeG1@larkfarm.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/5c97d4ff29cfd944da751f01177a3024626d57bb</url>
  <id>5c97d4ff29cfd944da751f01177a3024626d57bb</id>
  <committed-date>2008-10-25T02:22:44-07:00</committed-date>
  <authored-date>2008-10-25T02:19:39-07:00</authored-date>
  <message>&quot;raise NoMethodError&quot; raises NoMethodError. Raise it with NoMethodError.new instead.

Signed-off-by: Pratik Naik &lt;pratiknaik@gmail.com&gt;</message>
  <tree>4142a8173f00fa3ff1e03e513d18aeef89be3042</tree>
  <committer>
    <name>Pratik Naik</name>
    <login>lifo</login>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
