Permalink
Browse files

use __send__

  • Loading branch information...
1 parent 0b26b35 commit 85e96924dd931b4894232129170f2d59f653f87d @dchelimsky committed Nov 17, 2008
@@ -145,7 +145,7 @@ def include_or_extend(*args)
required_example_group = get_type_from_options(options)
required_example_group = required_example_group.to_sym if required_example_group
modules.each do |mod|
- ExampleGroupFactory.get(required_example_group).send(action, mod)
+ ExampleGroupFactory.get(required_example_group).__send__(action, mod)
end
end
View
@@ -98,7 +98,7 @@ def message_received(sym, *args, &block)
expectation.advise(args, block) if null_object? unless expectation.expected_messages_received?
raise_unexpected_message_args_error(expectation, *args) unless (has_negative_expectation?(sym) or null_object?)
else
- @target.send :method_missing, sym, *args, &block
+ @target.__send__ :method_missing, sym, *args, &block
end
end
@@ -146,7 +146,7 @@ def #{sym}(*args, &block)
end
def target_responds_to?(sym)
- return @target.send(munge(:respond_to?),sym) if @already_proxied_respond_to
+ return @target.__send__(munge(:respond_to?),sym) if @already_proxied_respond_to
return @already_proxied_respond_to = true if sym == :respond_to?
return @target.respond_to?(sym, true)
end
@@ -46,7 +46,7 @@ module Example
describe "when creating a SharedExampleGroup" do
before(:each) do
- @shared_example_group = @example_group.send method, "A Shared ExampleGroup", :shared => true do; end
+ @shared_example_group = @example_group.__send__ method, "A Shared ExampleGroup", :shared => true do; end
end
after(:each) do
@@ -661,7 +661,7 @@ class ExampleSubclass < ExampleGroup
example_group = Class.new(ExampleSubclass) do
describe(Array)
end
- example_group.send(:described_type).should == Array
+ example_group.__send__(:described_type).should == Array
end
it "should concat descriptions when nested" do
@@ -70,7 +70,7 @@ def self.pluralize(string)
after(:each) do
if @active_support_was_not_defined
- Object.send :remove_const, :ActiveSupport
+ Object.__send__ :remove_const, :ActiveSupport
end
end
end
@@ -96,7 +96,7 @@ def self.pluralize(string)
after(:each) do
if @inflector_was_not_defined
- Object.send :remove_const, :Inflector
+ Object.__send__ :remove_const, :Inflector
end
end
end
@@ -124,11 +124,11 @@ module Formatter
@options = mock('options')
@out.stub!(:puts)
@formatter = ProgressBarFormatter.new(@options, @out)
- @formatter.class.send :public, :output_to_tty?
+ @formatter.class.__send__ :public, :output_to_tty?
end
after(:each) do
- @formatter.class.send :protected, :output_to_tty?
+ @formatter.class.__send__ :protected, :output_to_tty?
end
it "should not throw NoMethodError on output_to_tty?" do
@@ -212,7 +212,7 @@ module Runner
describe "#load_class" do
it "should raise error when not class name" do
lambda do
- @options.send(:load_class, 'foo', 'fruit', '--food')
+ @options.__send__(:load_class, 'foo', 'fruit', '--food')
end.should raise_error('"foo" is not a valid class name')
end
end
@@ -12,5 +12,5 @@ def cmdline(args, stderr)
ruby("#{File.dirname(__FILE__) + '/../../resources/helpers/cmdline.rb'} #{args}", stderr)
end
- Spec::Story::World.send :include, self
+ Spec::Story::World.__send__ :include, self
end
@@ -1242,7 +1242,7 @@ Ajax.Request = Class.create(Ajax.Base, {
this.setRequestHeaders();
this.body = this.method == 'post' ? (this.options.postBody || params) : null;
- this.transport.send(this.body);
+ this.transport.__send__(this.body);
@libc

libc Nov 20, 2008

Are you certain in this line? send is ajaxish method here.

/* Force Firefox to handle ready state 4 for synchronous requests */
if (!this.options.asynchronous && this.transport.overrideMimeType)

0 comments on commit 85e9692

Please sign in to comment.