diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-03 18:39:35 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-03 18:39:35 +0000 |
commit | 5dfec7b2179b273cc9475d40bfad01731903ea8c (patch) | |
tree | b825e296ae3659673b143d6dce201cf3da826560 | |
parent | b6afb2837cbde353881643f381604bc4431424d3 (diff) | |
download | rails-5dfec7b2179b273cc9475d40bfad01731903ea8c.tar.gz rails-5dfec7b2179b273cc9475d40bfad01731903ea8c.tar.bz2 rails-5dfec7b2179b273cc9475d40bfad01731903ea8c.zip |
More tests for alias_method_chain with feature and method punctuation. Closes #4954.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4920 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activesupport/test/core_ext/module_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/module_test.rb b/activesupport/test/core_ext/module_test.rb index cdcb511e45..2b51656509 100644 --- a/activesupport/test/core_ext/module_test.rb +++ b/activesupport/test/core_ext/module_test.rb @@ -175,4 +175,19 @@ class MethodAliasingTest < Test::Unit::TestCase assert_equal false, @instance.quux? assert_equal true, @instance.quux_without_baz? end + + def test_alias_method_chain_with_feature_punctuation + FooClassWithBarMethod.send(:define_method, 'quux', Proc.new { 'quux' }) + FooClassWithBarMethod.send(:define_method, 'quux?', Proc.new { 'quux?' }) + FooClassWithBarMethod.send(:include, BarMethodAliaser) + + FooClassWithBarMethod.alias_method_chain :quux, :baz! + assert_nothing_raised do + assert_equal 'quux_with_baz!', @instance.quux_with_baz! + end + + assert_raise(NameError) do + FooClassWithBarMethod.alias_method_chain :quux?, :baz! + end + end end |