Permalink
Browse files

method_missing is private

  • Loading branch information...
dchelimsky committed Nov 19, 2010
1 parent 831403a commit 9571f5cb1bdc41a37da3d031f4818f23712476c2
Showing with 13 additions and 10 deletions.
  1. +3 −3 lib/rspec/matchers/have.rb
  2. +4 −4 lib/rspec/matchers/matcher.rb
  3. +6 −3 lib/rspec/matchers/method_missing.rb
@@ -73,10 +73,10 @@ def respond_to?(sym)
private
- def method_missing(sym, *args, &block)
- @collection_name = sym
+ def method_missing(method, *args, &block)
+ @collection_name = method
if inflector = (defined?(ActiveSupport::Inflector) && ActiveSupport::Inflector.respond_to?(:pluralize) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil))
- @plural_collection_name = inflector.pluralize(sym.to_s)
+ @plural_collection_name = inflector.pluralize(method.to_s)
end
@args = args
@block = block
@@ -107,11 +107,11 @@ def chain(method, &block)
private
- def method_missing(name, *args, &block)
- if $matcher_execution_context.respond_to?(name)
- $matcher_execution_context.send name, *args, &block
+ def method_missing(method, *args, &block)
+ if $matcher_execution_context.respond_to?(method)
+ $matcher_execution_context.send method, *args, &block
else
- super(name, *args, &block)
+ super(method, *args, &block)
end
end
@@ -1,8 +1,11 @@
module RSpec
module Matchers
- def method_missing(sym, *args, &block) # :nodoc:
- return Matchers::BePredicate.new(sym, *args, &block) if sym.to_s =~ /^be_/
- return Matchers::Has.new(sym, *args, &block) if sym.to_s =~ /^have_/
+
+ private
+
+ def method_missing(method, *args, &block) # :nodoc:
+ return Matchers::BePredicate.new(method, *args, &block) if method.to_s =~ /^be_/
+ return Matchers::Has.new(method, *args, &block) if method.to_s =~ /^have_/
super
end
end

0 comments on commit 9571f5c

Please sign in to comment.