aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-05-27 11:15:15 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2016-05-27 11:15:15 +0200
commit656788a8a5a94225a1c8c159299a6da960c0f26e (patch)
treeb4da72f6ab9cb9cb43bdc2ce6a6d97b08c93bf8a /activesupport/test
parentc34eefbaf92cfdd8b8db6e513e1c4f489af4c3c0 (diff)
parent30169e6ea53176e2fb4eb3b89d4faa93caff79b4 (diff)
downloadrails-656788a8a5a94225a1c8c159299a6da960c0f26e.tar.gz
rails-656788a8a5a94225a1c8c159299a6da960c0f26e.tar.bz2
rails-656788a8a5a94225a1c8c159299a6da960c0f26e.zip
Merge pull request #25157 from maclover7/jm-23930-add-tests
Add test for `delegate_missing_to` where method doesn't exist
Diffstat (limited to 'activesupport/test')
-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