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

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Modifies expectation so that when the expected method is called, it yields with the specified <tt>parameters</tt>.
- !ruby/struct:SM::Flow::VERB 
  body: "  object = mock()\n  object.expects(:expected_method).yields('result')\n  yielded_value = nil\n  object.expected_method { |value| yielded_value = value }\n  yielded_value # =&gt; 'result'\n"
- !ruby/struct:SM::Flow::P 
  body: May be called multiple times on the same expectation for consecutive invocations. Also see Expectation#then.
- !ruby/struct:SM::Flow::VERB 
  body: "  object = mock()\n  object.stubs(:expected_method).yields(1).then.yields(2)\n  yielded_values_from_first_invocation = []\n  yielded_values_from_second_invocation = []\n  object.expected_method { |value| yielded_values_from_first_invocation &lt;&lt; value } # first invocation\n  object.expected_method { |value| yielded_values_from_second_invocation &lt;&lt; value } # second invocation\n  yielded_values_from_first_invocation # =&gt; [1]\n  yielded_values_from_second_invocation # =&gt; [2]\n"
full_name: Mocha::Expectation#yields
is_singleton: false
name: yields
params: " yields(*parameters) -> expectation\n"
visibility: public
