aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-05-26 22:17:08 -0400
committerJon Moss <me@jonathanmoss.me>2016-05-26 22:17:08 -0400
commit30169e6ea53176e2fb4eb3b89d4faa93caff79b4 (patch)
tree49f0f02b07c8b7694b5bc7f4e8d51e024eb3c925 /activesupport
parent0a571e4ad416a72a5827d4bcca5e4f6e8920ec93 (diff)
downloadrails-30169e6ea53176e2fb4eb3b89d4faa93caff79b4.tar.gz
rails-30169e6ea53176e2fb4eb3b89d4faa93caff79b4.tar.bz2
rails-30169e6ea53176e2fb4eb3b89d4faa93caff79b4.zip
Add test for `delegate_missing_to` where method doesn't exist
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/core_ext/module_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb
index 1f84e11529..566f29b470 100644
--- a/activesupport/test/core_ext/module_test.rb
+++ b/activesupport/test/core_ext/module_test.rb
@@ -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