--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Constrains the expectation to occur only when the <tt>state_machine</tt> is in the named <tt>state</tt>.
- !ruby/struct:SM::Flow::P 
  body: See also API#states, StateMachine#starts_as and Expectation#then.
- !ruby/struct:SM::Flow::VERB 
  body: "  power = states('power').starts_as('off')\n\n  radio = mock('radio')\n  radio.expects(:switch_on).then(power.is('on'))\n  radio.expects(:select_channel).with('BBC Radio 4').when(power.is('on'))\n  radio.expects(:adjust_volume).with(+5).when(power.is('on'))\n  radio.expects(:select_channel).with('BBC World Service').when(power.is('on'))\n  radio.expects(:adjust_volume).with(-5).when(power.is('on'))\n  radio.expects(:switch_off).then(power.is('off'))\n"
full_name: Mocha::Expectation#when
is_singleton: false
name: when
params: " when(state_machine.is(state)) -> exception\n"
visibility: public
