Parent

Files

Mocha::StateMachine

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.

Public Instance Methods

become(next_state) click to toggle source

Put the state_machine into the next_state.

# File lib/mocha/state_machine.rb, line 63
def become(next_state)
  @current_state = next_state
end
is(state) click to toggle source

Determines whether the state_machine is in the specified state.

# File lib/mocha/state_machine.rb, line 70
def is(state)
  State.new(self, state)
end
is_not(state) click to toggle source

Determines whether the state_machine is not in the specified state.

# File lib/mocha/state_machine.rb, line 77
def is_not(state)
  StatePredicate.new(self, state)
end
starts_as(initial_state) → state_machine click to toggle source

Put the state_machine into the initial_state.

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.