webmock 1.12.0 → 1.12.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## 1.12.1
5
+
6
+ * Fixed Minitest < 5.0 compatibility
7
+
4
8
  ## 1.12.0
5
9
 
6
10
  * Not using Gem spec anymore to check loaded Curb version.
@@ -1,7 +1,16 @@
1
- require 'minitest/test'
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
- MiniTest::Test.class_eval do
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 += 1
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"
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '1.12.0' unless defined?(::WebMock::VERSION)
2
+ VERSION = '1.12.1' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -10,7 +10,9 @@ gem 'minitest'
10
10
  require 'minitest/autorun'
11
11
  require 'webmock/minitest'
12
12
 
13
- class MiniTest::Test
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)
@@ -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
- class MiniTestWebMock < MiniTest::Test
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: 39
4
+ hash: 37
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 12
9
- - 0
10
- version: 1.12.0
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-25 00:00:00 Z
18
+ date: 2013-06-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: addressable