vendor/bundle/ruby/1.8/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb
def mock_with(framework)
        framework_module = case framework
        when Module
          framework
        when String, Symbol
          require case framework.to_s
                  when /rspec/i
                    'rspec/core/mocking/with_rspec'
                  when /mocha/i
                    'rspec/core/mocking/with_mocha'
                  when /rr/i
                    'rspec/core/mocking/with_rr'
                  when /flexmock/i
                    'rspec/core/mocking/with_flexmock'
                  else
                    'rspec/core/mocking/with_absolutely_nothing'
                  end
          RSpec::Core::MockFrameworkAdapter
        end

        new_name, old_name = [framework_module, @mock_framework].map do |mod|
          mod.respond_to?(:framework_name) ?  mod.framework_name : :unnamed
        end

        unless new_name == old_name
          assert_no_example_groups_defined(:mock_framework)
        end

        @mock_framework = framework_module
      end
# Sets the mock framework adapter module.
#
# `framework` can be a Symbol or a Module.
#
# Given any of :rspec, :mocha, :flexmock, or :rr, configures the named
# framework.
#
# Given :nothing, configures no framework. Use this if you don't use any
# mocking framework to save a little bit of overhead.
#
# Given a Module, includes that module in every example group. The module
# should adhere to RSpec's mock framework adapter API:
#
#   setup_mocks_for_rspec
#     - called before each example
#
#   verify_mocks_for_rspec
#     - called after each example. Framework should raise an exception
#       when expectations fail
#
#   teardown_mocks_for_rspec
#     - called after verify_mocks_for_rspec (even if there are errors)
Sets the mock framework adapter module.
`framework` can be a Symbol or a Module.

Given any of :rspec, :mocha, :flexmock, or :rr, configures the named
framework.

Given :nothing, configures no framework. Use this if you don't use any
mocking framework to save a little bit of overhead.

Given a Module, includes that module in every example group. The module
should adhere to RSpec's mock framework adapter API.

setup_mocks_for_rspec
called before each example

verify_mocks_for_rspec
called after each example. Framework should raise an exception
when expectations fail

teardown_mocks_for_rspec
called after verify_mocks_for_rspec (even if there are errors)
Sets the mock framework adapter module . ` framework ` can be a Symbol or a Module . Given any of : rspec : mocha : flexmock or : rr configures the named framework . Given : nothing configures no framework . Use this if you don ' t use any mocking framework to save a little bit of overhead . Given a Module includes that module in every example group . The module should adhere to RSpec ' s mock framework adapter API . setup_mocks_for_rspec called before each example verify_mocks_for_rspec called after each example . Framework should raise an exception when expectations fail teardown_mocks_for_rspec called after verify_mocks_for_rspec ( even if there are errors )
def mock_with(framework)
        framework_module = case framework
        when Module
          framework
        when String, Symbol
          require case framework.to_s
                  when /rspec/i
                    'rspec/core/mocking/with_rspec'
                  when /mocha/i
                    'rspec/core/mocking/with_mocha'
                  when /rr/i
                    'rspec/core/mocking/with_rr'
                  when /flexmock/i
                    'rspec/core/mocking/with_flexmock'
                  else
                    'rspec/core/mocking/with_absolutely_nothing'
                  end
          RSpec::Core::MockFrameworkAdapter
        end
        new_name, old_name = [framework_module, @mock_framework].map do |mod|
          mod.respond_to?(:framework_name) ?  mod.framework_name : :unnamed
        end
        unless new_name == old_name
          assert_no_example_groups_defined(:mock_framework)
        end
        @mock_framework = framework_module
      end
def mock_with ( framework ) framework_module = case framework when Module framework when String , Symbol require case framework . to_s when / rspec /i 'rspec/core/mocking/with_rspec' when / mocha /i 'rspec/core/mocking/with_mocha' when / rr /i 'rspec/core/mocking/with_rr' when / flexmock /i 'rspec/core/mocking/with_flexmock' else 'rspec/core/mocking/with_absolutely_nothing' end RSpec :: Core :: MockFrameworkAdapter end new_name , old_name = [ framework_module , @mock_framework ] . map do | mod | mod . respond_to? ( :framework_name ) ? mod . framework_name : :unnamed end unless new_name == old_name assert_no_example_groups_defined ( :mock_framework ) end @mock_framework = framework_module end
Sets the mock framework adapter module.
Sets the mock framework adapter module .
framework