Permalink
Browse files

Moved two definitions to the correct module name since RSpec changed …

…the name of the module. Updated object#track_methods method to track all public methods if no arguments were passed in.
  • Loading branch information...
mbrennan committed Jun 29, 2009
1 parent 820c456 commit 0a5ceac98c289df5f505db59191bb645e154443d
Showing with 12 additions and 9 deletions.
  1. +8 −9 lib/not_a_mock/argument_constraint_extensions.rb
  2. +4 −0 lib/not_a_mock/object_extensions.rb
@@ -2,13 +2,6 @@
module Spec #:nodoc:
module Mocks #:nodoc:
class AnyArgConstraint #:nodoc:
def inspect
'anything'
end
end
class AnyOrderArgConstraint #:nodoc:
def initialize(array)
@array = array
@@ -23,11 +16,17 @@ def inspect
end
end
module ArgumentConstraintMatchers #:nodoc:
module ArgumentMatchers #:nodoc:
class AnyArgMatcher #:nodoc:
def inspect
'anything'
end
end
def in_any_order(array)
Spec::Mocks::AnyOrderArgConstraint.new(array)
end
end
end
end
@@ -6,6 +6,10 @@ class Object
# See NotAMock::Matchers for info on how to test which methods have been
# called, with what arguments, etc.
def track_methods(*methods)
if methods.empty?
self.public_methods(false).map {|method_name| methods << method_name.to_s.to_sym}
end
methods.each do |method|
NotAMock::CallRecorder.instance.track_method(self, method)
end

0 comments on commit 0a5ceac

Please sign in to comment.