diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-04-25 19:45:41 -0700 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-04-25 19:45:41 -0700 |
commit | 23b6e9d85d4a57ab0a24ae5e03965ff6c8de5bca (patch) | |
tree | 687a3ab3a44578ebd11772c68e06fcc6d4699df6 /activesupport/test | |
parent | d495606168f638b272f5775b2a0a796f13ab7c1b (diff) | |
parent | ccbe02343934956d3bb11c7167e0493f9d8f08fd (diff) | |
download | rails-23b6e9d85d4a57ab0a24ae5e03965ff6c8de5bca.tar.gz rails-23b6e9d85d4a57ab0a24ae5e03965ff6c8de5bca.tar.bz2 rails-23b6e9d85d4a57ab0a24ae5e03965ff6c8de5bca.zip |
Merge pull request #10347 from lellisga/delegation_bug_documentation
Delegation method bug
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/module_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb index 82249ddd1b..9a8582075d 100644 --- a/activesupport/test/core_ext/module_test.rb +++ b/activesupport/test/core_ext/module_test.rb @@ -171,6 +171,11 @@ class ModuleTest < ActiveSupport::TestCase assert_nil rails.name end + def test_delegation_with_allow_nil_and_invalid_value + rails = Project.new("Rails", "David") + assert_raise(NoMethodError) { rails.name } + end + def test_delegation_with_allow_nil_and_nil_value_and_prefix Project.class_eval do delegate :name, :to => :person, :allow_nil => true, :prefix => true |