aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-01-24 12:04:08 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-01-24 12:04:08 +0000
commit7fce529b2abbf19327b2be38f87daf338203d760 (patch)
treee3bca49da6d933fac57585e7d88af1e6b98f466a /actionpack
parentf08bd27398f11420a2bae5ac0be5f169650683a6 (diff)
downloadrails-7fce529b2abbf19327b2be38f87daf338203d760.tar.gz
rails-7fce529b2abbf19327b2be38f87daf338203d760.tar.bz2
rails-7fce529b2abbf19327b2be38f87daf338203d760.zip
Mocha 0.4 mixes in more public instance methods, confusing controller identification of action methods. Closes #7347.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6030 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/base_test.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index bcc473263f..bf1f6227fd 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -82,16 +82,14 @@ class ControllerInstanceTests < Test::Unit::TestCase
assert_equal Set.new('public_action'), c.send(:action_methods), "#{c.controller_path} should not be empty!"
end
end
-
+
protected
-
- # Mocha adds methods to Object which are then included in the public_instance_methods
- # This method hides those from the controller so the above tests won't know the difference
- def hide_mocha_methods_from_controller(controller)
- mocha_methods = [:expects, :metaclass, :mocha, :mocha_inspect, :reset_mocha, :stubba_object, :stubba_method, :stubs, :verify]
- controller.class.send(:hide_action, *mocha_methods)
- end
-
+ # Mocha adds some public instance methods to Object that would be
+ # considered actions, so explicitly hide_action them.
+ def hide_mocha_methods_from_controller(controller)
+ mocha_methods = [:expects, :metaclass, :mocha, :mocha_inspect, :reset_mocha, :stubba_object, :stubba_method, :stubs, :verify, :__metaclass__, :__is_a__]
+ controller.class.send(:hide_action, *mocha_methods)
+ end
end
@@ -133,4 +131,4 @@ class PerformActionTest < Test::Unit::TestCase
get :another_hidden_action
assert_response 404
end
-end \ No newline at end of file
+end