lib/mocktail.rb in mocktail-1.1.3 vs lib/mocktail.rb in mocktail-1.2.0

- old
+ new

@@ -1,5 +1,6 @@ +require_relative "mocktail/collects_calls" require_relative "mocktail/debug" require_relative "mocktail/dsl" require_relative "mocktail/errors" require_relative "mocktail/explains_thing" require_relative "mocktail/explains_nils" @@ -63,9 +64,16 @@ ExplainsThing.new.explain(thing) end def self.explain_nils ExplainsNils.new.explain + end + + # An alias for Mocktail.explain(double).reference.calls + # Takes an optional second parameter of the method name to filter only + # calls to that method + def self.calls(double, method_name = nil) + CollectsCalls.new.collect(double, method_name) end # Stores most transactional state about calls & stubbing configurations # Anything returned by this is undocumented and could change at any time, so # don't commit code that relies on it!