Skip to content
This repository
Browse code

method_missing is private

  • Loading branch information...
commit 9571f5cb1bdc41a37da3d031f4818f23712476c2 1 parent 831403a
David Chelimsky authored November 19, 2010
6  lib/rspec/matchers/have.rb
@@ -73,10 +73,10 @@ def respond_to?(sym)
73 73
     
74 74
       private
75 75
       
76  
-      def method_missing(sym, *args, &block)
77  
-        @collection_name = sym
  76
+      def method_missing(method, *args, &block)
  77
+        @collection_name = method
78 78
         if inflector = (defined?(ActiveSupport::Inflector) && ActiveSupport::Inflector.respond_to?(:pluralize) ? ActiveSupport::Inflector : (defined?(Inflector) ? Inflector : nil))
79  
-          @plural_collection_name = inflector.pluralize(sym.to_s)
  79
+          @plural_collection_name = inflector.pluralize(method.to_s)
80 80
         end
81 81
         @args = args
82 82
         @block = block
8  lib/rspec/matchers/matcher.rb
@@ -107,11 +107,11 @@ def chain(method, &block)
107 107
       
108 108
     private
109 109
 
110  
-      def method_missing(name, *args, &block)
111  
-        if $matcher_execution_context.respond_to?(name)
112  
-          $matcher_execution_context.send name, *args, &block
  110
+      def method_missing(method, *args, &block)
  111
+        if $matcher_execution_context.respond_to?(method)
  112
+          $matcher_execution_context.send method, *args, &block
113 113
         else
114  
-          super(name, *args, &block)
  114
+          super(method, *args, &block)
115 115
         end
116 116
       end
117 117
     
9  lib/rspec/matchers/method_missing.rb
... ...
@@ -1,8 +1,11 @@
1 1
 module RSpec
2 2
   module Matchers
3  
-    def method_missing(sym, *args, &block) # :nodoc:
4  
-      return Matchers::BePredicate.new(sym, *args, &block) if sym.to_s =~ /^be_/
5  
-      return Matchers::Has.new(sym, *args, &block) if sym.to_s =~ /^have_/
  3
+
  4
+    private
  5
+
  6
+    def method_missing(method, *args, &block) # :nodoc:
  7
+      return Matchers::BePredicate.new(method, *args, &block) if method.to_s =~ /^be_/
  8
+      return Matchers::Has.new(method, *args, &block) if method.to_s =~ /^have_/
6 9
       super
7 10
     end
8 11
   end

0 notes on commit 9571f5c

Please sign in to comment.
Something went wrong with that request. Please try again.