Skip to content
This repository
Browse code

minor refactoring: rename args_expectation to argument_expectation (i…

…nternal)
  • Loading branch information...
commit 4c32db1804bcbbbfe0860f97a181d186d1c88986 1 parent 59c41e8
David Chelimsky authored February 17, 2012

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  lib/rspec/mocks/message_expectation.rb
16  lib/rspec/mocks/message_expectation.rb
@@ -4,7 +4,7 @@ module Mocks
4 4
     class MessageExpectation
5 5
       # @private
6 6
       attr_reader :message
7  
-      attr_writer :expected_received_count, :method_block, :expected_from, :args_expectation
  7
+      attr_writer :expected_received_count, :method_block, :expected_from, :argument_expectation
8 8
       protected :expected_received_count=, :method_block=, :expected_from=
9 9
       attr_accessor :error_generator
10 10
       protected :error_generator, :error_generator=
@@ -19,7 +19,7 @@ def initialize(error_generator, expectation_ordering, expected_from, message, me
19 19
         @return_block = nil
20 20
         @actual_received_count = 0
21 21
         @expected_received_count = expected_received_count
22  
-        @args_expectation = ArgumentExpectation.new(ArgumentMatchers::AnyArgsMatcher.new)
  22
+        @argument_expectation = ArgumentExpectation.new(ArgumentMatchers::AnyArgsMatcher.new)
23 23
         @consecutive = false
24 24
         @exception_to_raise = nil
25 25
         @args_to_throw = []
@@ -45,13 +45,13 @@ def build_child(expected_from, method_block, expected_received_count, opts={})
45 45
         new_gen.opts = opts
46 46
         child.error_generator = new_gen
47 47
         child.clone_args_to_yield(*@args_to_yield)
48  
-        child.args_expectation = ArgumentExpectation.new(ArgumentMatchers::AnyArgsMatcher.new)
  48
+        child.argument_expectation = ArgumentExpectation.new(ArgumentMatchers::AnyArgsMatcher.new)
49 49
         child
50 50
       end
51 51
 
52 52
       # @private
53 53
       def expected_args
54  
-        @args_expectation.args
  54
+        @argument_expectation.args
55 55
       end
56 56
 
57 57
       # @overload and_return(value)
@@ -165,7 +165,7 @@ def and_yield(*args, &block)
165 165
 
166 166
       # @private
167 167
       def matches?(message, *args)
168  
-        @message == message and @args_expectation.args_match?(*args)
  168
+        @message == message and @argument_expectation.args_match?(*args)
169 169
       end
170 170
 
171 171
       # @private
@@ -217,7 +217,7 @@ def called_max_times?
217 217
 
218 218
       # @private
219 219
       def matches_name_but_not_args(message, *args)
220  
-        @message == message and not @args_expectation.args_match?(*args)
  220
+        @message == message and not @argument_expectation.args_match?(*args)
221 221
       end
222 222
 
223 223
       # @private
@@ -266,7 +266,7 @@ def advise(*args)
266 266
       # @private
267 267
       def generate_error
268 268
         if similar_messages.empty?
269  
-          @error_generator.raise_expectation_error(@message, @expected_received_count, @actual_received_count, *@args_expectation.args)
  269
+          @error_generator.raise_expectation_error(@message, @expected_received_count, @actual_received_count, *@argument_expectation.args)
270 270
         else
271 271
           @error_generator.raise_similar_message_args_error(self, *@similar_messages)
272 272
         end
@@ -302,7 +302,7 @@ def raise_out_of_order_error
302 302
       #   # => passes
303 303
       def with(*args, &block)
304 304
         @return_block = block if block_given? unless args.empty?
305  
-        @args_expectation = ArgumentExpectation.new(*args, &block)
  305
+        @argument_expectation = ArgumentExpectation.new(*args, &block)
306 306
         self
307 307
       end
308 308
 

0 notes on commit 4c32db1

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