Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 24 lines (19 sloc) 0.622 kb
3ca443e WebMock module has to be included manually and is not included by RSpec ...
Bartosz Blimke authored
1 require 'rubygems'
2
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
3 $LOAD_PATH.unshift(File.dirname(__FILE__))
4 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3ca443e WebMock module has to be included manually and is not included by RSpec ...
Bartosz Blimke authored
5
95e8298 Revert "WebMock module has to be included manually and is not included b...
Bartosz Blimke authored
6 require 'webmock/test_unit'
7 require 'test/unit'
8
2e88f99 Updated info on how to include WebMock in Test::Unit and RSpec without p...
Bartosz Blimke authored
9 class Test::Unit::TestCase
7d2f07a @bblimke Removed assertion_failure from WebMock module.
authored
10 AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion
b457d38 @bblimke Added minitest spec to ensure webmock works with Minitest::Spec. Unfortu...
authored
11 def assert_raise_with_message(e, message, &block)
12 e = assert_raise(e, &block)
df682b0 @bblimke Ensure test/unit tests pass on multiple versions of ruby
authored
13 if message.is_a?(Regexp)
14 assert_match(message, e.message)
15 else
16 assert_equal(message, e.message)
17 end
2e88f99 Updated info on how to include WebMock in Test::Unit and RSpec without p...
Bartosz Blimke authored
18 end
b457d38 @bblimke Added minitest spec to ensure webmock works with Minitest::Spec. Unfortu...
authored
19
20 def assert_fail(message, &block)
21 assert_raise_with_message(AssertionFailedError, message, &block)
22 end
2e88f99 Updated info on how to include WebMock in Test::Unit and RSpec without p...
Bartosz Blimke authored
23 end
Something went wrong with that request. Please try again.