Sha256: 53605a1400a059beb1f5358859cb6aca83d4ce88e3a06f1599c4cf8cf7490cfa

Contents?: true

Size: 1.3 KB

Versions: 7065

Compression:

Stored size: 1.3 KB

Contents

# In order to support all versions of mocha, we have to jump through some
# hoops here.
#
# mocha >= '0.13.0':
#   require 'mocha/api' is required.
#   require 'mocha/object' raises a LoadError b/c the file no longer exists.
# mocha < '0.13.0', >= '0.9.7'
#   require 'mocha/api' is required.
#   require 'mocha/object' is required.
# mocha < '0.9.7':
#   require 'mocha/api' raises a LoadError b/c the file does not yet exist.
#   require 'mocha/standalone' is required.
#   require 'mocha/object' is required.
begin
  require 'mocha/api'

  begin
    require 'mocha/object'
  rescue LoadError
    # Mocha >= 0.13.0 no longer contains this file nor needs it to be loaded.
  end
rescue LoadError
  require 'mocha/standalone'
  require 'mocha/object'
end

module RSpec
  module Core
    module MockingAdapters
      # @private
      module Mocha
        def self.framework_name
          :mocha
        end

        # Mocha::Standalone was deprecated as of Mocha 0.9.7.
        begin
          include ::Mocha::API
        rescue NameError
          include ::Mocha::Standalone
        end

        def setup_mocks_for_rspec
          mocha_setup
        end

        def verify_mocks_for_rspec
          mocha_verify
        end

        def teardown_mocks_for_rspec
          mocha_teardown
        end
      end
    end
  end
end

Version data entries

7,065 entries across 6,983 versions & 126 rubygems

Version Path
cybrid_api_id_ruby-0.122.67 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_bank_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_organization_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_id_ruby-0.122.66 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_id_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_bank_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_organization_ruby-0.122.65 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_bank_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_id_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_organization_ruby-0.122.64 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_id_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_bank_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_organization_ruby-0.122.60 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_organization_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_bank_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_id_ruby-0.122.59 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_bank_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_organization_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_id_ruby-0.122.58 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb
cybrid_api_id_ruby-0.122.57 vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib/rspec/core/mocking_adapters/mocha.rb