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:
parent
0a571e4ad4
commit
30169e6ea5
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue