webmock 1.12.0 → 1.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/webmock/minitest.rb +12 -3
- data/lib/webmock/version.rb +1 -1
- data/minitest/test_helper.rb +3 -1
- data/minitest/test_webmock.rb +4 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/lib/webmock/minitest.rb
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'minitest/test'
|
3
|
+
test_class= MiniTest::Test
|
4
|
+
assertions = "assertions"
|
5
|
+
rescue LoadError
|
6
|
+
require "minitest/unit"
|
7
|
+
test_class = MiniTest::Unit::TestCase
|
8
|
+
assertions = "_assertions"
|
9
|
+
end
|
10
|
+
|
2
11
|
require 'webmock'
|
3
12
|
|
4
|
-
|
13
|
+
test_class.class_eval do
|
5
14
|
include WebMock::API
|
6
15
|
|
7
16
|
alias_method :teardown_without_webmock, :teardown
|
@@ -14,7 +23,7 @@ MiniTest::Test.class_eval do
|
|
14
23
|
[:assert_request_requested, :assert_request_not_requested].each do |name|
|
15
24
|
alias_method :"#{name}_without_assertions_count", name
|
16
25
|
define_method :"#{name}_with_assertions_count" do |*args|
|
17
|
-
self.assertions
|
26
|
+
self.send("#{assertions}=", self.send("#{assertions}") + 1)
|
18
27
|
send :"#{name}_without_assertions_count", *args
|
19
28
|
end
|
20
29
|
alias_method name, :"#{name}_with_assertions_count"
|
data/lib/webmock/version.rb
CHANGED
data/minitest/test_helper.rb
CHANGED
@@ -10,7 +10,9 @@ gem 'minitest'
|
|
10
10
|
require 'minitest/autorun'
|
11
11
|
require 'webmock/minitest'
|
12
12
|
|
13
|
-
|
13
|
+
test_class = defined?(MiniTest::Test) ? MiniTest::Test : MiniTest::Unit::TestCase
|
14
|
+
|
15
|
+
test_class.class_eval do
|
14
16
|
|
15
17
|
def assert_raise(*exp, &block)
|
16
18
|
assert_raises(*exp, &block)
|
data/minitest/test_webmock.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
|
2
2
|
require File.expand_path(File.dirname(__FILE__) + '/../test/shared_test')
|
3
3
|
|
4
|
-
|
4
|
+
test_class = defined?(MiniTest::Test) ? MiniTest::Test : MiniTest::Unit::TestCase
|
5
|
+
|
6
|
+
|
7
|
+
class MiniTestWebMock < test_class
|
5
8
|
include SharedTest
|
6
9
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 1.12.
|
9
|
+
- 1
|
10
|
+
version: 1.12.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bartosz Blimke
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-06-
|
18
|
+
date: 2013-06-26 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: addressable
|