freerange/mocha — pull request #161 by ThomasSevestre (2013-07-08 10:26:49+00:00)
Title: add state machine callbacks

Hello,

Here is a patch to add callbacks on state machines.

For instance, this allow to stub methods in a specific state only:

state= states('state_machine').starts_as('first_state')
state.enter_state('second_state') { my_object.subs(:my_method) }
state.exit_state('second_state') { my_object.unstub(:my_method) }