diff options
author | Prem Sichanugrist <s@sikachu.com> | 2011-04-13 00:04:40 +0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-04-13 20:25:28 +0800 |
commit | 733bfa63f5d8d3b963202b6d3e9f00b4db070b91 (patch) | |
tree | 10febe66946c850ce8e6bc0c9560d55d83b7a608 /actionpack/lib/action_dispatch/testing | |
parent | 1f869114f5f671160653eb6f15d2850d82217fe5 (diff) | |
download | rails-733bfa63f5d8d3b963202b6d3e9f00b4db070b91.tar.gz rails-733bfa63f5d8d3b963202b6d3e9f00b4db070b91.tar.bz2 rails-733bfa63f5d8d3b963202b6d3e9f00b4db070b91.zip |
Remove `#among?` from Active Support
After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.
It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index 16a6b93ce8..8a04cfa886 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -35,7 +35,7 @@ module ActionDispatch def assert_response(type, message = nil) validate_request! - if type.among?(:success, :missing, :redirect, :error) && @response.send("#{type}?") + if type.in?([:success, :missing, :redirect, :error]) && @response.send("#{type}?") assert_block("") { true } # to count the assertion elsif type.is_a?(Fixnum) && @response.response_code == type assert_block("") { true } # to count the assertion diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 174babb9aa..7d707d03a9 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -321,7 +321,7 @@ module ActionDispatch define_method(method) do |*args| reset! unless integration_session # reset the html_document variable, but only for new get/post calls - @html_document = nil unless method.among?("cookies", "assigns") + @html_document = nil unless method.in?(["cookies", "assigns"]) integration_session.__send__(method, *args).tap do copy_session_variables! end |