# File lib/mocha/expectation.rb, line 355 def when(state_predicate) add_ordering_constraint(InStateOrderingConstraint.new(state_predicate)) self end