Sha256: acc256f5219f6cbf5b96ee792485b20e3e6f52926d9b336736ab2e70f113f59a

Contents?: true

Size: 1020 Bytes

Versions: 111

Compression:

Stored size: 1020 Bytes

Contents

begin
  require 'minitest/test'
  test_class = Minitest::Test
  assertions = "assertions"
rescue LoadError
  require "minitest/unit"
  test_class = MiniTest::Unit::TestCase
  assertions = "_assertions"
end

require 'webmock'

WebMock.enable!

test_class.class_eval do
  include WebMock::API

  alias_method :teardown_without_webmock, :teardown
  def teardown_with_webmock
    teardown_without_webmock
    WebMock.reset!
  end
  alias_method :teardown, :teardown_with_webmock

  [:assert_request_requested, :assert_request_not_requested].each do |name|
    alias_method :"#{name}_without_assertions_count", name
    define_method :"#{name}_with_assertions_count" do |*args|
      self.send("#{assertions}=", self.send("#{assertions}") + 1)
      send :"#{name}_without_assertions_count", *args
    end
    alias_method name, :"#{name}_with_assertions_count"
  end
end

begin
  error_class = MiniTest::Assertion
rescue NameError
  error_class = Minitest::Assertion
end

WebMock::AssertionFailure.error_class = error_class

Version data entries

111 entries across 105 versions & 8 rubygems

Version Path
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb
webmock-3.13.0 lib/webmock/minitest.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/webmock-2.3.2/lib/webmock/minitest.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/webmock-2.3.2/lib/webmock/minitest.rb
webmock-3.12.2 lib/webmock/minitest.rb
webmock-3.12.1 lib/webmock/minitest.rb
webmock-3.12.0 lib/webmock/minitest.rb
webmock-3.11.3 lib/webmock/minitest.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/webmock-3.11.2/lib/webmock/minitest.rb
webmock-3.11.2 lib/webmock/minitest.rb
webmock-3.11.1 lib/webmock/minitest.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/webmock-2.3.2/lib/webmock/minitest.rb