webmock 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2360898f731c7559973a74945b09dec9b49d4e8
4
- data.tar.gz: 544e6b9f40279e95d88a79d6b3fa80b2ed875862
3
+ metadata.gz: c1069c0a60e8b12e1b55267f15e1e4fb3d57835b
4
+ data.tar.gz: 2cc2741c7f3a459e1f861d2975a71b5faa2a97a8
5
5
  SHA512:
6
- metadata.gz: 026d14aa0f2605e6ee7f229fa9bf5b47efabd51b8b17dc939b0202c65c922c5a11952ba5b025eb0d4f6b9c38c0c5e8a03b77f03afea4997013e54ef7d6c1d89e
7
- data.tar.gz: 5634533246d042db493ae69993f4bb59f13aae9510a888008f50d98bcac85d8561380229098eaa3dab86bfe22160d50f523feace61e64e48464791885eb2f332
6
+ metadata.gz: ed37a77fc5f8f16a5d672439a576a977d01dc930455cbe8e3acd65ad571c368597cbcfb21b98c8cb6f6173e877a8a955e4879ba62d73592e36f723594f45e00e
7
+ data.tar.gz: 6c9d14043a5f3fd8f359a6b4750c045c65b80c32fd8028c004f10b78fa80c586a2d81c21f1ac4ed6d6d1fba318c8c5ef071f54f5c665d3064c35157eda9dcb8a
@@ -1,17 +1,21 @@
1
1
  rvm:
2
+ - 1.9.3
2
3
  - 2.0.0
3
4
  - 2.1.0
4
5
  - 2.2.1
5
6
  - 2.2.3
6
7
  - 2.3.0
7
- - ruby-2.4.0-preview3
8
+ - 2.4.0
8
9
  - rbx-2
9
10
  - ruby-head
10
- - jruby-9.0.5.0
11
- - jruby-9.1.5.0
11
+ - jruby-9.0.0.0
12
+ - jruby-9.0.1.0
13
+ - jruby-19mode
14
+ - jruby
12
15
  - jruby-head
13
16
  matrix:
14
17
  allow_failures:
18
+ - rvm: jruby-9.0.0.0
15
19
  - rvm: jruby-head
16
20
  - rvm: ruby-head
17
21
  - rvm: rbx-2
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.2
4
+
5
+ * Restored support for Ruby 1.9.3 to comply with semantic versioning.
6
+
7
+ Thanks to [Jordan Harband](https://github.com/ljharb) for reporting the problem.
8
+
3
9
  ## 2.3.1
4
10
 
5
11
  * Added support for Ruby 2.4
data/README.md CHANGED
@@ -32,7 +32,8 @@ Supported HTTP libraries
32
32
  Supported Ruby Interpreters
33
33
  ---------------------------
34
34
 
35
- * MRI 2.0
35
+ * MRI 1.9.3
36
+ * MRI 2.0.0
36
37
  * MRI 2.1
37
38
  * MRI 2.2
38
39
  * MRI 2.3
@@ -1027,6 +1028,7 @@ People who submitted patches and new features or suggested improvements. Many th
1027
1028
  * Aleksei Maridashvili
1028
1029
  * Ville Lautanala
1029
1030
  * Koichi ITO
1031
+ * Jordan Harband
1030
1032
 
1031
1033
  For a full list of contributors you can visit the
1032
1034
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -183,6 +183,9 @@ module WebMock
183
183
  if defined?(Net::OpenTimeout)
184
184
  # Ruby 2.x
185
185
  Net::OpenTimeout
186
+ elsif defined?(Net::HTTP::OpenTimeout)
187
+ # Ruby 1.9
188
+ Net::HTTP::OpenTimeout
186
189
  else
187
190
  # Fallback, if things change
188
191
  Timeout::Error
@@ -256,7 +259,21 @@ end
256
259
  module Net #:nodoc: all
257
260
 
258
261
  class WebMockNetBufferedIO < BufferedIO
259
- def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
262
+ if RUBY_VERSION <= '1.9.3'
263
+ class_eval <<-DEFINE_METHOD
264
+ def initialize(io, debug_output = nil)
265
+ common_initialize(io, debug_output)
266
+ end
267
+ DEFINE_METHOD
268
+ else
269
+ class_eval <<-DEFINE_METHOD
270
+ def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
271
+ common_initialize(io, debug_output)
272
+ end
273
+ DEFINE_METHOD
274
+ end
275
+
276
+ def common_initialize(io, debug_output = nil)
260
277
  @read_timeout = 60
261
278
  @rbuf = ''
262
279
  @debug_output = debug_output
@@ -19,4 +19,4 @@ module Test
19
19
  end
20
20
  end
21
21
 
22
- WebMock::AssertionFailure.error_class = Test::Unit::AssertionFailedError
22
+ WebMock::AssertionFailure.error_class = Test::Unit::AssertionFailedError rescue MiniTest::Assertion # ruby1.9 compat
@@ -48,11 +48,21 @@ module WebMock
48
48
  right_pos = marks << json.bytesize
49
49
  output = []
50
50
 
51
- left_pos.each_with_index do |left, i|
52
- if json.respond_to?(:byteslice)
53
- output << json.byteslice(left.succ..right_pos[i])
54
- else
55
- output << json[left.succ..right_pos[i]]
51
+ if RUBY_VERSION != "1.9.2"
52
+ left_pos.each_with_index do |left, i|
53
+ if json.respond_to?(:byteslice)
54
+ output << json.byteslice(left.succ..right_pos[i])
55
+ else
56
+ output << json[left.succ..right_pos[i]]
57
+ end
58
+ end
59
+ else
60
+ json_as_binary = json.force_encoding("binary")
61
+ left_pos.each_with_index do |left, i|
62
+ output << json_as_binary[left.succ..right_pos[i]]
63
+ end
64
+ output.map! do |binary_str|
65
+ binary_str.force_encoding("UTF-8")
56
66
  end
57
67
  end
58
68
 
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '2.3.1' unless defined?(::WebMock::VERSION)
2
+ VERSION = '2.3.2' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -7,6 +7,7 @@ module HTTPClientSpecHelper
7
7
  uri = Addressable::URI.heuristic_parse(uri)
8
8
  c = options.fetch(:client) { HTTPClient.new }
9
9
  c.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
10
+ c.reset_all
10
11
  if options[:basic_auth]
11
12
  c.force_basic_auth = true
12
13
  c.set_basic_auth(nil, options[:basic_auth][0], options[:basic_auth][1])
@@ -18,7 +18,7 @@ shared_examples_for "stubbing requests" do |*adapter_info|
18
18
  expect(http_request(:get, "http://www.example.com/hello+/?#{NOT_ESCAPED_PARAMS}").body).to eq("abc")
19
19
  end
20
20
 
21
- it "should return stubbed response for url with non utf query params" do
21
+ it "should return stubbed response for url with non utf query params", "ruby>1.9" => true do
22
22
  param = 'aäoöuü'.encode('iso-8859-1')
23
23
  param = CGI.escape(param)
24
24
  stub_request(:get, "www.example.com/?#{param}").to_return(body: "abc")
@@ -15,9 +15,9 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.rubyforge_project = 'webmock'
17
17
 
18
- s.required_ruby_version = '>= 2.0'
18
+ s.required_ruby_version = '>= 1.9.3'
19
19
 
20
- s.add_dependency 'addressable', '>= 2.3.6'
20
+ s.add_dependency 'addressable', '>= 2.3.6', ('<= 2.4.0' if RUBY_VERSION <= '1.9.3')
21
21
  s.add_dependency 'crack', '>= 0.3.2'
22
22
  s.add_dependency 'hashdiff'
23
23
 
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  s.add_development_dependency 'typhoeus', '>= 0.5.0'
28
28
  end
29
29
 
30
- s.add_development_dependency 'http', '>= 0.8.0'
30
+ s.add_development_dependency 'http', ((RUBY_VERSION <= '1.9.3') ? '0.7.3' : '>= 0.8.0')
31
31
  s.add_development_dependency 'manticore', '>= 0.5.1' if RUBY_PLATFORM =~ /java/
32
32
  s.add_development_dependency 'rack', ((RUBY_VERSION < '2.2.2') ? '1.6.0' : '> 1.6')
33
33
  s.add_development_dependency 'rspec', '>= 3.1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Blimke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-06 00:00:00.000000000 Z
11
+ date: 2017-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: rack
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '='
115
+ - - ">"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.6.0
117
+ version: '1.6'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '='
122
+ - - ">"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.6.0
124
+ version: '1.6'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -386,7 +386,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
386
386
  requirements:
387
387
  - - ">="
388
388
  - !ruby/object:Gem::Version
389
- version: '2.0'
389
+ version: 1.9.3
390
390
  required_rubygems_version: !ruby/object:Gem::Requirement
391
391
  requirements:
392
392
  - - ">="
@@ -394,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
394
394
  version: '0'
395
395
  requirements: []
396
396
  rubyforge_project: webmock
397
- rubygems_version: 2.2.2
397
+ rubygems_version: 2.6.8
398
398
  signing_key:
399
399
  specification_version: 4
400
400
  summary: Library for stubbing HTTP requests in Ruby.