From a1eb4e11c2cccb91483fa15f1a1a0b2ae518d2cf Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 31 Aug 2008 13:15:26 -0700 Subject: Get rid of 'Object#send!'. It was originally added because it's in Ruby 1.9, but it has since been removed from 1.9. Signed-off-by: Jeremy Kemper Conflicts: actionpack/test/controller/layout_test.rb --- activeresource/test/authorization_test.rb | 16 ++++++++-------- activeresource/test/base/load_test.rb | 4 ++-- activeresource/test/base_test.rb | 8 ++++---- activeresource/test/connection_test.rb | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) (limited to 'activeresource/test') diff --git a/activeresource/test/authorization_test.rb b/activeresource/test/authorization_test.rb index 9215227620..ead7f5c12f 100644 --- a/activeresource/test/authorization_test.rb +++ b/activeresource/test/authorization_test.rb @@ -19,7 +19,7 @@ class AuthorizationTest < Test::Unit::TestCase end def test_authorization_header - authorization_header = @authenticated_conn.send!(:authorization_header) + authorization_header = @authenticated_conn.__send__(:authorization_header) assert_equal @authorization_request_header['Authorization'], authorization_header['Authorization'] authorization = authorization_header["Authorization"].to_s.split @@ -29,7 +29,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_with_username_but_no_password @conn = ActiveResource::Connection.new("http://david:@localhost") - authorization_header = @conn.send!(:authorization_header) + authorization_header = @conn.__send__(:authorization_header) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -38,7 +38,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_with_password_but_no_username @conn = ActiveResource::Connection.new("http://:test123@localhost") - authorization_header = @conn.send!(:authorization_header) + authorization_header = @conn.__send__(:authorization_header) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -47,7 +47,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_with_decoded_credentials_from_url @conn = ActiveResource::Connection.new("http://my%40email.com:%31%32%33@localhost") - authorization_header = @conn.send!(:authorization_header) + authorization_header = @conn.__send__(:authorization_header) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -58,7 +58,7 @@ class AuthorizationTest < Test::Unit::TestCase @authenticated_conn = ActiveResource::Connection.new("http://@localhost") @authenticated_conn.user = 'david' @authenticated_conn.password = 'test123' - authorization_header = @authenticated_conn.send!(:authorization_header) + authorization_header = @authenticated_conn.__send__(:authorization_header) assert_equal @authorization_request_header['Authorization'], authorization_header['Authorization'] authorization = authorization_header["Authorization"].to_s.split @@ -69,7 +69,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_explicitly_setting_username_but_no_password @conn = ActiveResource::Connection.new("http://@localhost") @conn.user = "david" - authorization_header = @conn.send!(:authorization_header) + authorization_header = @conn.__send__(:authorization_header) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -79,7 +79,7 @@ class AuthorizationTest < Test::Unit::TestCase def test_authorization_header_explicitly_setting_password_but_no_username @conn = ActiveResource::Connection.new("http://@localhost") @conn.password = "test123" - authorization_header = @conn.send!(:authorization_header) + authorization_header = @conn.__send__(:authorization_header) authorization = authorization_header["Authorization"].to_s.split assert_equal "Basic", authorization[0] @@ -116,7 +116,7 @@ class AuthorizationTest < Test::Unit::TestCase protected def assert_response_raises(klass, code) assert_raise(klass, "Expected response code #{code} to raise #{klass}") do - @conn.send!(:handle_response, Response.new(code)) + @conn.__send__(:handle_response, Response.new(code)) end end end diff --git a/activeresource/test/base/load_test.rb b/activeresource/test/base/load_test.rb index 737afb1748..a475fab34e 100644 --- a/activeresource/test/base/load_test.rb +++ b/activeresource/test/base/load_test.rb @@ -84,7 +84,7 @@ class BaseLoadTest < Test::Unit::TestCase end def test_load_collection_with_unknown_resource - Person.send!(:remove_const, :Address) if Person.const_defined?(:Address) + Person.__send__(:remove_const, :Address) if Person.const_defined?(:Address) assert !Person.const_defined?(:Address), "Address shouldn't exist until autocreated" addresses = silence_warnings { @person.load(:addresses => @addresses).addresses } assert Person.const_defined?(:Address), "Address should have been autocreated" @@ -100,7 +100,7 @@ class BaseLoadTest < Test::Unit::TestCase end def test_load_collection_with_single_unknown_resource - Person.send!(:remove_const, :Address) if Person.const_defined?(:Address) + Person.__send__(:remove_const, :Address) if Person.const_defined?(:Address) assert !Person.const_defined?(:Address), "Address shouldn't exist until autocreated" addresses = silence_warnings { @person.load(:addresses => [ @first_address ]).addresses } assert Person.const_defined?(:Address), "Address should have been autocreated" diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb index e3f0719819..7460fd45b0 100644 --- a/activeresource/test/base_test.rb +++ b/activeresource/test/base_test.rb @@ -468,7 +468,7 @@ class BaseTest < Test::Unit::TestCase def test_prefix assert_equal "/", Person.prefix - assert_equal Set.new, Person.send!(:prefix_parameters) + assert_equal Set.new, Person.__send__(:prefix_parameters) end def test_set_prefix @@ -504,7 +504,7 @@ class BaseTest < Test::Unit::TestCase def test_custom_prefix assert_equal '/people//', StreetAddress.prefix assert_equal '/people/1/', StreetAddress.prefix(:person_id => 1) - assert_equal [:person_id].to_set, StreetAddress.send!(:prefix_parameters) + assert_equal [:person_id].to_set, StreetAddress.__send__(:prefix_parameters) end def test_find_by_id @@ -607,10 +607,10 @@ class BaseTest < Test::Unit::TestCase def test_id_from_response p = Person.new resp = {'Location' => '/foo/bar/1'} - assert_equal '1', p.send!(:id_from_response, resp) + assert_equal '1', p.__send__(:id_from_response, resp) resp['Location'] << '.xml' - assert_equal '1', p.send!(:id_from_response, resp) + assert_equal '1', p.__send__(:id_from_response, resp) end def test_create_with_custom_prefix diff --git a/activeresource/test/connection_test.rb b/activeresource/test/connection_test.rb index 8e43e451ff..06f31f1b57 100644 --- a/activeresource/test/connection_test.rb +++ b/activeresource/test/connection_test.rb @@ -185,6 +185,6 @@ class ConnectionTest < Test::Unit::TestCase end def handle_response(response) - @conn.send!(:handle_response, response) + @conn.__send__(:handle_response, response) end end -- cgit v1.2.3