webmock 2.2.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDA0NGYxYjJmZGI0OTNjMjhlNDhjMWRkNTMwZWZlNTQ4ZjhkZDljOQ==
5
- data.tar.gz: !binary |-
6
- MjgyODBlOWY3ODE1MmM0OTk4NDE5NzU1NjhkYzRiN2QwN2Q5MzZiNA==
2
+ SHA1:
3
+ metadata.gz: e2360898f731c7559973a74945b09dec9b49d4e8
4
+ data.tar.gz: 544e6b9f40279e95d88a79d6b3fa80b2ed875862
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZjZiYWFmOTJjMDc3Yzk3Y2M1M2UxNzMyYWVkOWNiNTYyMWQzZTJhZDNmMjA3
10
- ZjcxMjI5N2QzNTBhNTVlYzI4OTFlNjMyYTZlNjNiNjNkNmUxYThlYjQ1MzNm
11
- YjlhMWI5YTE5OTZmYThiYTJhNTllOGRjNTkzYWEwY2U1M2M5ZmE=
12
- data.tar.gz: !binary |-
13
- NjI2YzNjODk0ZDBmNTM4N2NkMmU1NGZkNDVlOWFiZTUwYmQ3NGE0ZDJmYWRj
14
- OTNjYmE3MWQxMTdmMzMwYTY5NmI1MWE5ODQ4YWY5MGQ2YWIzYTQ0NWVjMmJk
15
- NGFiZjYzZTc4MzM4MWNlYWFjOGMzMTIwODY1M2NlZjFmYmRmNzU=
6
+ metadata.gz: 026d14aa0f2605e6ee7f229fa9bf5b47efabd51b8b17dc939b0202c65c922c5a11952ba5b025eb0d4f6b9c38c0c5e8a03b77f03afea4997013e54ef7d6c1d89e
7
+ data.tar.gz: 5634533246d042db493ae69993f4bb59f13aae9510a888008f50d98bcac85d8561380229098eaa3dab86bfe22160d50f523feace61e64e48464791885eb2f332
@@ -1,5 +1,4 @@
1
1
  rvm:
2
- - 1.9.3
3
2
  - 2.0.0
4
3
  - 2.1.0
5
4
  - 2.2.1
@@ -8,14 +7,11 @@ rvm:
8
7
  - ruby-2.4.0-preview3
9
8
  - rbx-2
10
9
  - ruby-head
11
- - jruby-9.0.0.0
12
- - jruby-9.0.1.0
13
- - jruby-19mode
14
- - jruby
10
+ - jruby-9.0.5.0
11
+ - jruby-9.1.5.0
15
12
  - jruby-head
16
13
  matrix:
17
14
  allow_failures:
18
- - rvm: jruby-9.0.0.0
19
15
  - rvm: jruby-head
20
16
  - rvm: ruby-head
21
17
  - rvm: rbx-2
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.1
4
+
5
+ * Added support for Ruby 2.4
6
+
7
+ Thanks to [Koichi ITO](https://github.com/koic)
8
+
9
+ * Dropped support for Ruby 1.9.3
10
+
3
11
  ## 2.2.0
4
12
 
5
13
  * Added `refute_requested` as an alias for `assert_not_requested`
data/README.md CHANGED
@@ -32,11 +32,11 @@ Supported HTTP libraries
32
32
  Supported Ruby Interpreters
33
33
  ---------------------------
34
34
 
35
- * MRI 1.9.3
36
- * MRI 2.0.0
35
+ * MRI 2.0
37
36
  * MRI 2.1
38
37
  * MRI 2.2
39
38
  * MRI 2.3
39
+ * MRI 2.4
40
40
  * JRuby
41
41
  * Rubinius
42
42
 
@@ -1026,6 +1026,7 @@ People who submitted patches and new features or suggested improvements. Many th
1026
1026
  * Michael Grosser
1027
1027
  * Aleksei Maridashvili
1028
1028
  * Ville Lautanala
1029
+ * Koichi ITO
1029
1030
 
1030
1031
  For a full list of contributors you can visit the
1031
1032
  [contributors](https://github.com/bblimke/webmock/contributors) page.
@@ -183,9 +183,6 @@ 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
189
186
  else
190
187
  # Fallback, if things change
191
188
  Timeout::Error
@@ -248,6 +245,9 @@ class StubSocket #:nodoc:
248
245
  @closed ||= true
249
246
  end
250
247
 
248
+ def close
249
+ end
250
+
251
251
  def readuntil(*args)
252
252
  end
253
253
 
@@ -256,7 +256,7 @@ end
256
256
  module Net #:nodoc: all
257
257
 
258
258
  class WebMockNetBufferedIO < BufferedIO
259
- def initialize(io, debug_output = nil)
259
+ def initialize(io, read_timeout: 60, continue_timeout: nil, debug_output: nil)
260
260
  @read_timeout = 60
261
261
  @rbuf = ''
262
262
  @debug_output = debug_output
@@ -62,7 +62,7 @@ module WebMock
62
62
  end
63
63
 
64
64
  def times(number)
65
- raise "times(N) accepts integers >= 1 only" if !number.is_a?(Fixnum) || number < 1
65
+ raise "times(N) accepts integers >= 1 only" if !number.is_a?(Integer) || number < 1
66
66
  if @responses_sequences.empty?
67
67
  raise "Invalid WebMock stub declaration." +
68
68
  " times(N) can be declared only after response declaration."
@@ -19,4 +19,4 @@ module Test
19
19
  end
20
20
  end
21
21
 
22
- WebMock::AssertionFailure.error_class = Test::Unit::AssertionFailedError rescue MiniTest::Assertion # ruby1.9 compat
22
+ WebMock::AssertionFailure.error_class = Test::Unit::AssertionFailedError
@@ -48,21 +48,11 @@ module WebMock
48
48
  right_pos = marks << json.bytesize
49
49
  output = []
50
50
 
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")
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]]
66
56
  end
67
57
  end
68
58
 
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '2.2.0' unless defined?(::WebMock::VERSION)
2
+ VERSION = '2.3.1' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -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", "ruby>1.9" => true do
21
+ it "should return stubbed response for url with non utf query params" 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 = '>= 1.9.3'
18
+ s.required_ruby_version = '>= 2.0'
19
19
 
20
- s.add_dependency 'addressable', '>= 2.3.6', ('<= 2.4.0' if RUBY_VERSION <= '1.9.3')
20
+ s.add_dependency 'addressable', '>= 2.3.6'
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', ((RUBY_VERSION <= '1.9.3') ? '0.7.3' : '>= 0.8.0')
30
+ s.add_development_dependency 'http', '>= 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,119 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.1
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-04 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.3.6
20
- - - <=
21
- - !ruby/object:Gem::Version
22
- version: 2.4.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 2.3.6
30
- - - <=
31
- - !ruby/object:Gem::Version
32
- version: 2.4.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: crack
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - ! '>='
31
+ - - ">="
38
32
  - !ruby/object:Gem::Version
39
33
  version: 0.3.2
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - ! '>='
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
40
  version: 0.3.2
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: hashdiff
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
- - - ! '>='
52
+ - - ">="
59
53
  - !ruby/object:Gem::Version
60
54
  version: '0'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: patron
63
57
  requirement: !ruby/object:Gem::Requirement
64
58
  requirements:
65
- - - ! '>='
59
+ - - ">="
66
60
  - !ruby/object:Gem::Version
67
61
  version: 0.4.18
68
62
  type: :development
69
63
  prerelease: false
70
64
  version_requirements: !ruby/object:Gem::Requirement
71
65
  requirements:
72
- - - ! '>='
66
+ - - ">="
73
67
  - !ruby/object:Gem::Version
74
68
  version: 0.4.18
75
69
  - !ruby/object:Gem::Dependency
76
70
  name: curb
77
71
  requirement: !ruby/object:Gem::Requirement
78
72
  requirements:
79
- - - ! '>='
73
+ - - ">="
80
74
  - !ruby/object:Gem::Version
81
75
  version: 0.7.16
82
76
  type: :development
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
- - - ! '>='
80
+ - - ">="
87
81
  - !ruby/object:Gem::Version
88
82
  version: 0.7.16
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: typhoeus
91
85
  requirement: !ruby/object:Gem::Requirement
92
86
  requirements:
93
- - - ! '>='
87
+ - - ">="
94
88
  - !ruby/object:Gem::Version
95
89
  version: 0.5.0
96
90
  type: :development
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
- - - ! '>='
94
+ - - ">="
101
95
  - !ruby/object:Gem::Version
102
96
  version: 0.5.0
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: http
105
99
  requirement: !ruby/object:Gem::Requirement
106
100
  requirements:
107
- - - '='
101
+ - - ">="
108
102
  - !ruby/object:Gem::Version
109
- version: 0.7.3
103
+ version: 0.8.0
110
104
  type: :development
111
105
  prerelease: false
112
106
  version_requirements: !ruby/object:Gem::Requirement
113
107
  requirements:
114
- - - '='
108
+ - - ">="
115
109
  - !ruby/object:Gem::Version
116
- version: 0.7.3
110
+ version: 0.8.0
117
111
  - !ruby/object:Gem::Dependency
118
112
  name: rack
119
113
  requirement: !ruby/object:Gem::Requirement
@@ -132,112 +126,112 @@ dependencies:
132
126
  name: rspec
133
127
  requirement: !ruby/object:Gem::Requirement
134
128
  requirements:
135
- - - ! '>='
129
+ - - ">="
136
130
  - !ruby/object:Gem::Version
137
131
  version: 3.1.0
138
132
  type: :development
139
133
  prerelease: false
140
134
  version_requirements: !ruby/object:Gem::Requirement
141
135
  requirements:
142
- - - ! '>='
136
+ - - ">="
143
137
  - !ruby/object:Gem::Version
144
138
  version: 3.1.0
145
139
  - !ruby/object:Gem::Dependency
146
140
  name: httpclient
147
141
  requirement: !ruby/object:Gem::Requirement
148
142
  requirements:
149
- - - ! '>='
143
+ - - ">="
150
144
  - !ruby/object:Gem::Version
151
145
  version: 2.2.4
152
146
  type: :development
153
147
  prerelease: false
154
148
  version_requirements: !ruby/object:Gem::Requirement
155
149
  requirements:
156
- - - ! '>='
150
+ - - ">="
157
151
  - !ruby/object:Gem::Version
158
152
  version: 2.2.4
159
153
  - !ruby/object:Gem::Dependency
160
154
  name: em-http-request
161
155
  requirement: !ruby/object:Gem::Requirement
162
156
  requirements:
163
- - - ! '>='
157
+ - - ">="
164
158
  - !ruby/object:Gem::Version
165
159
  version: 1.0.2
166
160
  type: :development
167
161
  prerelease: false
168
162
  version_requirements: !ruby/object:Gem::Requirement
169
163
  requirements:
170
- - - ! '>='
164
+ - - ">="
171
165
  - !ruby/object:Gem::Version
172
166
  version: 1.0.2
173
167
  - !ruby/object:Gem::Dependency
174
168
  name: em-synchrony
175
169
  requirement: !ruby/object:Gem::Requirement
176
170
  requirements:
177
- - - ! '>='
171
+ - - ">="
178
172
  - !ruby/object:Gem::Version
179
173
  version: 1.0.0
180
174
  type: :development
181
175
  prerelease: false
182
176
  version_requirements: !ruby/object:Gem::Requirement
183
177
  requirements:
184
- - - ! '>='
178
+ - - ">="
185
179
  - !ruby/object:Gem::Version
186
180
  version: 1.0.0
187
181
  - !ruby/object:Gem::Dependency
188
182
  name: excon
189
183
  requirement: !ruby/object:Gem::Requirement
190
184
  requirements:
191
- - - ! '>='
185
+ - - ">="
192
186
  - !ruby/object:Gem::Version
193
187
  version: 0.27.5
194
188
  type: :development
195
189
  prerelease: false
196
190
  version_requirements: !ruby/object:Gem::Requirement
197
191
  requirements:
198
- - - ! '>='
192
+ - - ">="
199
193
  - !ruby/object:Gem::Version
200
194
  version: 0.27.5
201
195
  - !ruby/object:Gem::Dependency
202
196
  name: minitest
203
197
  requirement: !ruby/object:Gem::Requirement
204
198
  requirements:
205
- - - ! '>='
199
+ - - ">="
206
200
  - !ruby/object:Gem::Version
207
201
  version: 5.0.0
208
202
  type: :development
209
203
  prerelease: false
210
204
  version_requirements: !ruby/object:Gem::Requirement
211
205
  requirements:
212
- - - ! '>='
206
+ - - ">="
213
207
  - !ruby/object:Gem::Version
214
208
  version: 5.0.0
215
209
  - !ruby/object:Gem::Dependency
216
210
  name: test-unit
217
211
  requirement: !ruby/object:Gem::Requirement
218
212
  requirements:
219
- - - ! '>='
213
+ - - ">="
220
214
  - !ruby/object:Gem::Version
221
215
  version: 3.0.0
222
216
  type: :development
223
217
  prerelease: false
224
218
  version_requirements: !ruby/object:Gem::Requirement
225
219
  requirements:
226
- - - ! '>='
220
+ - - ">="
227
221
  - !ruby/object:Gem::Version
228
222
  version: 3.0.0
229
223
  - !ruby/object:Gem::Dependency
230
224
  name: rdoc
231
225
  requirement: !ruby/object:Gem::Requirement
232
226
  requirements:
233
- - - ! '>'
227
+ - - ">"
234
228
  - !ruby/object:Gem::Version
235
229
  version: 3.5.0
236
230
  type: :development
237
231
  prerelease: false
238
232
  version_requirements: !ruby/object:Gem::Requirement
239
233
  requirements:
240
- - - ! '>'
234
+ - - ">"
241
235
  - !ruby/object:Gem::Version
242
236
  version: 3.5.0
243
237
  description: WebMock allows stubbing HTTP requests and setting expectations on HTTP
@@ -248,10 +242,10 @@ executables: []
248
242
  extensions: []
249
243
  extra_rdoc_files: []
250
244
  files:
251
- - .gemtest
252
- - .gitignore
253
- - .rspec-tm
254
- - .travis.yml
245
+ - ".gemtest"
246
+ - ".gitignore"
247
+ - ".rspec-tm"
248
+ - ".travis.yml"
255
249
  - CHANGELOG.md
256
250
  - Gemfile
257
251
  - LICENSE
@@ -390,17 +384,17 @@ require_paths:
390
384
  - lib
391
385
  required_ruby_version: !ruby/object:Gem::Requirement
392
386
  requirements:
393
- - - ! '>='
387
+ - - ">="
394
388
  - !ruby/object:Gem::Version
395
- version: 1.9.3
389
+ version: '2.0'
396
390
  required_rubygems_version: !ruby/object:Gem::Requirement
397
391
  requirements:
398
- - - ! '>='
392
+ - - ">="
399
393
  - !ruby/object:Gem::Version
400
394
  version: '0'
401
395
  requirements: []
402
396
  rubyforge_project: webmock
403
- rubygems_version: 2.6.8
397
+ rubygems_version: 2.2.2
404
398
  signing_key:
405
399
  specification_version: 4
406
400
  summary: Library for stubbing HTTP requests in Ruby.