--- !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 returns the specified <tt>value</tt>.
- !ruby/struct:SM::Flow::VERB 
  body: "  object = mock()\n  object.stubs(:stubbed_method).returns('result')\n  object.stubbed_method # =&gt; 'result'\n  object.stubbed_method # =&gt; 'result'\n"
- !ruby/struct:SM::Flow::P 
  body: If multiple <tt>values</tt> are given, these are returned in turn on consecutive calls to the method.
- !ruby/struct:SM::Flow::VERB 
  body: "  object = mock()\n  object.stubs(:stubbed_method).returns(1, 2)\n  object.stubbed_method # =&gt; 1\n  object.stubbed_method # =&gt; 2\n"
- !ruby/struct:SM::Flow::P 
  body: May be called multiple times on the same expectation. Also see Expectation#then.
- !ruby/struct:SM::Flow::VERB 
  body: "  object = mock()\n  object.stubs(:expected_method).returns(1, 2).then.returns(3)\n  object.expected_method # =&gt; 1\n  object.expected_method # =&gt; 2\n  object.expected_method # =&gt; 3\n"
- !ruby/struct:SM::Flow::P 
  body: May be called in conjunction with Expectation#raises on the same expectation.
- !ruby/struct:SM::Flow::VERB 
  body: "  object = mock()\n  object.stubs(:expected_method).returns(1, 2).then.raises(Exception)\n  object.expected_method # =&gt; 1\n  object.expected_method # =&gt; 2\n  object.expected_method # =&gt; raises exception of class Exception1\n"
- !ruby/struct:SM::Flow::P 
  body: If <tt>value</tt> is a <tt>Proc</tt>, then the expected method will return the result of calling <tt>Proc#call</tt>.
- !ruby/struct:SM::Flow::P 
  body: This usage is <em>deprecated</em>. Use explicit multiple return values and/or multiple expectations instead.
- !ruby/struct:SM::Flow::P 
  body: A <tt>Proc</tt> instance will be treated the same as any other value in a future release.
- !ruby/struct:SM::Flow::VERB 
  body: "  object = mock()\n  object.stubs(:stubbed_method).returns(lambda { rand(100) })\n  object.stubbed_method # =&gt; 41\n  object.stubbed_method # =&gt; 77\n"
full_name: Mocha::Expectation#returns
is_singleton: false
name: returns
params: " returns(value) -> expectation\n\
  returns(*values) -> expectation\n"
visibility: public
