vendor/gems/flexmock-0.8.5/lib/flexmock/core_class_methods.rb
def use(*names)
      names = ["unknown"] if names.empty?
      container = UseContainer.new
      mocks = names.collect { |n| container.flexmock(n) }
      yield(*mocks)
    rescue Exception => ex
      container.got_exception = true
      raise
    ensure
      container.flexmock_teardown
    end
# Class method to make sure that verify is called at the end of a
# test.  One mock object will be created for each name given to
# the use method.  The mocks will be passed to the block as
# arguments.  If no names are given, then a single anonymous mock
# object will be created.
#
# At the end of the use block, each mock object will be verified
# to make sure the proper number of calls have been made.
#
# Usage:
#
#   FlexMock.use("name") do |mock|    # Creates a mock named "name"
#     mock.should_receive(:meth).
#       returns(0).once
#   end                               # mock is verified here
#
# NOTE: If you include FlexMock::TestCase into your test case
# file, you can create mocks that will be automatically verified in
# the test teardown by using the +flexmock+ method.
#
Class method to make sure that verify is called at the end of a
test.  One mock object will be created for each name given to
the use method.  The mocks will be passed to the block as
arguments.  If no names are given, then a single anonymous mock
object will be created.

At the end of the use block, each mock object will be verified
to make sure the proper number of calls have been made.



FlexMock.use("name") do |mock|    # Creates a mock named "name"
mock.should_receive(:meth).
returns(0).once
end                               # mock is verified here

If you include FlexMock::TestCase into your test case
file, you can create mocks that will be automatically verified in
the test teardown by using the +flexmock+ method.
Class method to make sure that verify is called at the end of a test . One mock object will be created for each name given to the use method . The mocks will be passed to the block as arguments . If no names are given then a single anonymous mock object will be created . At the end of the use block each mock object will be verified to make sure the proper number of calls have been made . FlexMock . use ( " name " ) do |mock| # Creates a mock named " name " mock . should_receive ( : meth ) . returns ( 0 ) . once end # mock is verified here If you include FlexMock :: TestCase into your test case file you can create mocks that will be automatically verified in the test teardown by using the + flexmock + method .
def use(*names)
      names = ["unknown"] if names.empty?
      container = UseContainer.new
      mocks = names.collect { |n| container.flexmock(n) }
      yield(*mocks)
    rescue Exception => ex
      container.got_exception = true
      raise
    ensure
      container.flexmock_teardown
    end
def use ( * names ) names = [ "unknown" ] if names . empty? container = UseContainer . new mocks = names . collect { | n | container . flexmock ( n ) } yield ( * mocks ) rescue Exception => ex container . got_exception = true raise ensure container . flexmock_teardown end
Class method to make sure that verify is called at the end of a
test.
Class method to make sure that verify is called at the end of a test .
names