Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created February 13, 2013 04:28
Show Gist options
  • Save myronmarston/4942267 to your computer and use it in GitHub Desktop.
Save myronmarston/4942267 to your computer and use it in GitHub Desktop.
Usages of `send` in rspec-expectations
➜ lib git:(master) ack send
rspec/matchers/built_in/be.rb
102: @actual.__send__ @operator, @expected
139: return @result = actual.__send__(predicate, *@args, &@block)
145: return @result = actual.__send__(present_tense_predicate, *@args, &@block)
rspec/matchers/built_in/change.rb
7: @value_proc = block || lambda {receiver.__send__(message)}
rspec/matchers/built_in/exist.rb
12: existence_values = predicates.map { |p| @actual.__send__(p, *@expected) }
rspec/matchers/built_in/has.rb
10: actual.__send__(predicate(@expected), *@args)
rspec/matchers/built_in/have.rb
27: @actual = collection.__send__(query_method)
38: collection_or_owner.__send__(@collection_name, *@args, &@block)
40: collection_or_owner.__send__(@plural_collection_name, *@args, &@block)
44: collection_or_owner.__send__(@collection_name, *@args, &@block)
rspec/matchers/built_in/include.rb
32: expecteds.__send__(predicate) do |expected|
34: expected.__send__(hash_predicate) { |k,v|
rspec/matchers/built_in/respond_to.rb
45: @failing_method_names = @names.__send__(filter_method) do |name|
rspec/matchers/extensions/instance_eval_with_args.rb
31: return __send__(method_name, *args)
rspec/matchers/matcher.rb
234: matcher_execution_context.__send__ method, *args, &block
241: singleton_class.__send__(:include, *args)
245: singleton_class.__send__(:define_method, name, &block)
261: (private_methods - orig_private_methods).each {|m| singleton_class.__send__ :public, m}
276: __send__("default_#{key}")
rspec/matchers/operator_matcher.rb
35: @actual.__send__(::RSpec::Matchers.last_should, matcher.new(expected))
91: if actual.__send__(operator, expected)
103: return false unless actual.__send__(operator, expected)
rspec/matchers.rb
168: MiniTest::Unit::TestCase.send(:include, self)
171: Test::Unit::TestCase.send(:include, self)
279: # @param [Symbol] message the message to send the receiver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment