From 733bfa63f5d8d3b963202b6d3e9f00b4db070b91 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Wed, 13 Apr 2011 00:04:40 +0800 Subject: 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?`. --- actionpack/test/controller/mime_responds_test.rb | 2 +- actionpack/test/dispatch/routing_test.rb | 2 +- actionpack/test/template/form_helper_test.rb | 2 +- actionpack/test/template/form_options_helper_test.rb | 2 +- actionpack/test/template/form_tag_helper_test.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/mime_responds_test.rb b/actionpack/test/controller/mime_responds_test.rb index 9e09fc39ed..4a5e597500 100644 --- a/actionpack/test/controller/mime_responds_test.rb +++ b/actionpack/test/controller/mime_responds_test.rb @@ -157,7 +157,7 @@ class RespondToController < ActionController::Base protected def set_layout - if action_name.among?("all_types_with_layout", "iphone_with_html_response_type") + if action_name.in?(["all_types_with_layout", "iphone_with_html_response_type"]) "respond_to/layouts/standard" elsif action_name == "iphone_with_html_response_type_without_layout" "respond_to/layouts/missing" diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index cf7a5aaa3b..ba7506721f 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -496,7 +496,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest resources :todos, :id => /\d+/ end - scope '/countries/:country', :constraints => lambda { |params, req| params[:country].among?("all", "France") } do + scope '/countries/:country', :constraints => lambda { |params, req| params[:country].in?(["all", "France"]) } do match '/', :to => 'countries#index' match '/cities', :to => 'countries#cities' end diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 435ce81238..7afab3179c 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -1744,7 +1744,7 @@ class FormHelperTest < ActionView::TestCase def snowman(method = nil) txt = %{
} txt << %{} - if method && !method.to_s.among?('get', 'post') + if method && !method.to_s.in?(['get', 'post']) txt << %{} end txt << %{
} diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index 76236aee41..b92e1d9890 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -83,7 +83,7 @@ class FormOptionsHelperTest < ActionView::TestCase def test_collection_options_with_proc_for_disabled assert_dom_equal( "\n\n", - options_from_collection_for_select(dummy_posts, "author_name", "title", :disabled => lambda{|p| p.author_name.among?("Babe", "Cabe") }) + options_from_collection_for_select(dummy_posts, "author_name", "title", :disabled => lambda{|p| p.author_name.in?(["Babe", "Cabe"]) }) ) end diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index aa2114ff79..656fa0356b 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -14,7 +14,7 @@ class FormTagHelperTest < ActionView::TestCase txt = %{
} txt << %{} - if method && !method.to_s.among?('get','post') + if method && !method.to_s.in?(['get','post']) txt << %{} end txt << %{
} -- cgit v1.2.3