class Mocha::StateMachine

def is(state_name)

Returns:
  • (State) - state which, when activated, will change the {StateMachine} into the state with the specified +desired_state_name+.
  • (StatePredicate) - state predicate which, when queried, will indicate whether the {StateMachine} is in the state specified by +expected_state_name+
  • (StatePredicate, State) - (a) state predicate which, when queried, will indicate whether the {StateMachine} is in the given state; or (b) state which, when activated, will change the {StateMachine} into the given state.

Parameters:
  • desired_state_name (String) -- name of desired new state.
  • expected_state_name (String) -- name of expected state.
  • state_name (String) -- name of expected/desired state.

Overloads:
  • def is(desired_state_name)
  • def is(expected_state_name)
def is(state_name)
  State.new(self, state_name, 'is') { |current, given| current == given }
end