vendor/bundle/ruby/1.8/gems/rspec-mocks-2.8.0/lib/rspec/mocks/message_expectation.rb
def and_yield(*args, &block)
        if @args_to_yield_were_cloned
          @args_to_yield.clear
          @args_to_yield_were_cloned = false
        end

        if block
          @eval_context = Object.new
          @eval_context.extend RSpec::Mocks::InstanceExec
          yield @eval_context
        end

        @args_to_yield << args
        self
      end
# Tells the object to yield one or more args to a block when the message
# is received.
#
# @example
#
#   stream.stub(:open).and_yield(StringIO.new)
Tells the object to yield one or more args to a block when the message
is received.
Tells the object to yield one or more args to a block when the message is received .
def and_yield(*args, &block)
        if @args_to_yield_were_cloned
          @args_to_yield.clear
          @args_to_yield_were_cloned = false
        end
        if block
          @eval_context = Object.new
          @eval_context.extend RSpec::Mocks::InstanceExec
          yield @eval_context
        end
        @args_to_yield << args
        self
      end
def and_yield ( * args , & block ) if @args_to_yield_were_cloned @args_to_yield . clear @args_to_yield_were_cloned = false end if block @eval_context = Object . new @eval_context . extend RSpec :: Mocks :: InstanceExec yield @eval_context end @args_to_yield << args self end
Tells the object to yield one or more args to a block when the message
is received.
Tells the object to yield one or more args to a block when the message is received .
args
block
example
None