Skip to content

Commit

Permalink
Don't recurse infinitely when calling non-existent method on super
Browse files Browse the repository at this point in the history
  • Loading branch information
kemper authored and tenderlove committed May 22, 2014
1 parent b318758 commit a2f13e1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions activerecord/test/cases/attribute_methods_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,18 @@ def title?
assert_equal !real_topic.title?, klass.find(real_topic.id).title?
end

def test_calling_super_when_parent_does_not_define_method_raises_error
klass = new_topic_like_ar_class do
def some_method_that_is_not_on_super
super
end
end

assert_raise(NoMethodError) do
klass.new.some_method_that_is_not_on_super
end
end

private

def new_topic_like_ar_class(&block)
Expand Down

0 comments on commit a2f13e1

Please sign in to comment.