Sha256: 3d0dfed4449ceb17ed1c4d5ae5c9e37c0294174676161f4a9ddeaf067cdce5a2

Contents?: true

Size: 750 Bytes

Versions: 4

Compression:

Stored size: 750 Bytes

Contents

require 'webmock'

# RSpec 1.x and 2.x compatibility
if defined?(RSpec) && defined?(RSpec::Expectations)
  RSPEC_NAMESPACE = RSPEC_CONFIGURER = RSpec
elsif defined?(Spec)
  RSPEC_NAMESPACE = Spec
  RSPEC_CONFIGURER = Spec::Runner
else  
  begin
    require 'rspec/core'
    require 'rspec/expectations'
    RSPEC_NAMESPACE = RSPEC_CONFIGURER = RSpec
  rescue LoadError
    require 'spec'
    RSPEC_NAMESPACE = Spec
    RSPEC_CONFIGURER = Spec::Runner
  end
end

require 'webmock/rspec/matchers'
  
RSPEC_CONFIGURER.configure { |config|

  config.include WebMock::API
  config.include WebMock::Matchers

  config.after(:each) do
    WebMock.reset!
  end
}

WebMock::AssertionFailure.error_class = RSPEC_NAMESPACE::Expectations::ExpectationNotMetError

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/webmock-1.6.4/lib/webmock/rspec.rb
webmock-1.6.4 lib/webmock/rspec.rb
webmock-1.6.2 lib/webmock/rspec.rb
webmock-1.6.1 lib/webmock/rspec.rb