Sha256: d386e1159b9d4b2250e641699f79994265d16fd7986062b1f6b97ef3256d6668

Contents?: true

Size: 608 Bytes

Versions: 15

Compression:

Stored size: 608 Bytes

Contents

require 'test/unit'
require 'webmock'

class Test::Unit::TestCase
  alias setup_without_webmock setup
  def setup
    WebMock.reset_webmock
    @original_allow_net_connect = WebMock.net_connect_allowed?
    WebMock.disable_net_connect!
  end

  alias teardown_without_webmock teardown
  def teardown
    @original_allow_net_connect ? WebMock.allow_net_connect! : WebMock.disable_net_connect!
  end
end

module WebMock
  AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion # ruby1.9 compat
  def assertion_failure(message)
    raise AssertionFailedError.new(message)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webmock-1.3.5 lib/webmock/adapters/test_unit.rb
webmock-1.3.4 lib/webmock/adapters/test_unit.rb
webmock-1.3.3 lib/webmock/adapters/test_unit.rb
webmock-1.3.2 lib/webmock/adapters/test_unit.rb
webmock-1.3.1 lib/webmock/adapters/test_unit.rb
webmock-1.3.0 lib/webmock/adapters/test_unit.rb
webmock-1.2.2 lib/webmock/adapters/test_unit.rb
webmock-1.2.1 lib/webmock/adapters/test_unit.rb
webmock-1.2.0 lib/webmock/adapters/test_unit.rb
webmock-1.1.0 lib/webmock/adapters/test_unit.rb
webmock-1.0.0 lib/webmock/adapters/test_unit.rb
webmock-0.9.1 lib/webmock/adapters/test_unit.rb
webmock-0.9.0 lib/webmock/adapters/test_unit.rb
webmock-0.8.2 lib/webmock/adapters/test_unit.rb
webmock-0.8.1 lib/webmock/adapters/test_unit.rb