Class Mocha::StateMachine
In: lib/mocha/state_machine.rb
Parent: Object

A state machine that is used to constrain the order of invocations. An invocation can be constrained to occur when a state is, or is_not, active.

Methods

become   is   is_not   starts_as  

Public Instance methods

Put the state_machine into the next_state.

[Source]

    # File lib/mocha/state_machine.rb, line 63
63:     def become(next_state)
64:       @current_state = next_state
65:     end

Determines whether the state_machine is in the specified state.

[Source]

    # File lib/mocha/state_machine.rb, line 70
70:     def is(state)
71:       State.new(self, state)
72:     end

Determines whether the state_machine is not in the specified state.

[Source]

    # File lib/mocha/state_machine.rb, line 77
77:     def is_not(state)
78:       StatePredicate.new(self, state)
79:     end

Put the state_machine into the initial_state.

[Source]

    # File lib/mocha/state_machine.rb, line 55
55:     def starts_as(initial_state)
56:       become(initial_state)
57:       self
58:     end

[Validate]