From 687b94374ce7822a22ec603a1ddb08a0574975b7 Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Wed, 8 Jul 2009 00:07:29 -0700 Subject: [PATCH] Clarification re spy properties. --- README.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.markdown b/README.markdown index d469e77..8ddf9ae 100644 --- a/README.markdown +++ b/README.markdown @@ -347,6 +347,8 @@ There are spy-specfic matchers that are very handy. `wasNotCalledWith(arguments)` returns true if the object is a spy and was not called with the passed arguments +Spies can be trained to respond in a variety of ways when invoked: + `andCallThrough()`: spies on AND calls the original function spied on `andReturn(arguments)`: returns passed arguments when spy is called @@ -355,6 +357,8 @@ There are spy-specfic matchers that are very handy. `andCallFake(function)`: calls passed function when spy is called +Spies have some useful properties: + `callCount`: returns number of times spy was called `mostRecentCall.args`: returns argument array from last call to spy.