1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test for delegate_missing_to where method doesn't exist

This commit is contained in:
Jon Moss 2016-05-26 22:17:08 -04:00
parent 0a571e4ad4
commit 30169e6ea5
No known key found for this signature in database
GPG key ID: 7CE26AA47EFC5B12

View file

@ -367,6 +367,14 @@ class ModuleTest < ActiveSupport::TestCase
assert_match(/undefined method `private_name' for/, e.message)
end
def test_delegate_to_missing_does_not_delegate_to_fake_methods
e = assert_raises(NoMethodError) do
DecoratedReserved.new(@david).my_fake_method
end
assert_match(/undefined method `my_fake_method' for/, e.message)
end
def test_parent
assert_equal Yz::Zy, Yz::Zy::Cd.parent
assert_equal Yz, Yz::Zy.parent