webmock 1.12.2 → 1.12.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -2
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/webmock/http_lib_adapters/httpclient_adapter.rb +1 -1
- data/lib/webmock/http_lib_adapters/net_http.rb +2 -2
- data/lib/webmock/version.rb +1 -1
- data/spec/acceptance/httpclient/httpclient_spec.rb +27 -0
- data/spec/acceptance/net_http/net_http_spec.rb +2 -2
- metadata +4 -4
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.12.3
|
4
|
+
|
5
|
+
* Fixed issue with handling Addressable::URI with query params passed to `Net::HTTP.get_response`
|
6
|
+
|
7
|
+
Thanks to [Leif Bladt](https://github.com/leifbladt)
|
8
|
+
|
9
|
+
* Fixed HTTPClient adapter to not raise an error if a request with multipart body is executed.
|
10
|
+
|
3
11
|
## 1.12.2
|
4
12
|
|
5
13
|
* Fixed issue with handling request.path when Addressable::URI is passed to #request instead of URI with Ruby 2.0.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
WebMock [![Build Status](https://secure.travis-ci.org/bblimke/webmock.png?branch=master)](http://travis-ci.org/bblimke/webmock) [![Dependency Status](https://gemnasium.com/bblimke/webmock.png)](http://gemnasium.com/bblimke/webmock)
|
1
|
+
WebMock [![Build Status](https://secure.travis-ci.org/bblimke/webmock.png?branch=master)](http://travis-ci.org/bblimke/webmock) [![Dependency Status](https://gemnasium.com/bblimke/webmock.png)](http://gemnasium.com/bblimke/webmock) [![Stories in Ready](http://badge.waffle.io/bblimke/webmock.png)](http://waffle.io/bblimke/webmock)
|
2
2
|
=======
|
3
3
|
|
4
4
|
Library for stubbing and setting expectations on HTTP requests in Ruby.
|
@@ -236,8 +236,8 @@ module WebMock
|
|
236
236
|
|
237
237
|
path = request.path
|
238
238
|
|
239
|
-
if path.respond_to?(:
|
240
|
-
path = path.
|
239
|
+
if path.respond_to?(:request_uri) #https://github.com/bblimke/webmock/issues/288
|
240
|
+
path = path.request_uri
|
241
241
|
end
|
242
242
|
|
243
243
|
path = WebMock::Util::URI.heuristic_parse(path).request_uri if path =~ /^http/
|
data/lib/webmock/version.rb
CHANGED
@@ -8,6 +8,7 @@ describe "HTTPClient" do
|
|
8
8
|
include HTTPClientSpecHelper
|
9
9
|
|
10
10
|
before(:each) do
|
11
|
+
WebMock.reset_callbacks
|
11
12
|
HTTPClientSpecHelper.async_mode = false
|
12
13
|
end
|
13
14
|
|
@@ -46,6 +47,32 @@ describe "HTTPClient" do
|
|
46
47
|
str.should == 'test'
|
47
48
|
end
|
48
49
|
|
50
|
+
context "multipart bodies" do
|
51
|
+
let(:header) {{
|
52
|
+
'Accept' => 'application/json',
|
53
|
+
'Content-Type' => 'multipart/form-data'
|
54
|
+
}}
|
55
|
+
|
56
|
+
let(:body) {[
|
57
|
+
{
|
58
|
+
'Content-Type' => 'application/json',
|
59
|
+
'Content-Disposition' => 'form-data',
|
60
|
+
:content => '{"foo": "bar", "baz": 2}'
|
61
|
+
}
|
62
|
+
]}
|
63
|
+
|
64
|
+
let(:make_request) {HTTPClient.new.post("http://www.example.com", body: body, header: header)}
|
65
|
+
|
66
|
+
before do
|
67
|
+
stub_request(:post, "www.example.com")
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should work with multipart bodies" do
|
71
|
+
make_request
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
|
49
76
|
context "Filters" do
|
50
77
|
class Filter
|
51
78
|
def filter_request(request)
|
@@ -159,8 +159,8 @@ describe "Net:HTTP" do
|
|
159
159
|
end
|
160
160
|
|
161
161
|
it "should work with Addressable::URI passed to Net::HTTP.get_response" do
|
162
|
-
stub_request(:get, 'http://www.example.com')
|
163
|
-
Net::HTTP.get_response(Addressable::URI.parse('http://www.example.com/'))
|
162
|
+
stub_request(:get, 'http://www.example.com/hello?a=1').to_return(:body => "abc")
|
163
|
+
Net::HTTP.get_response(Addressable::URI.parse('http://www.example.com/hello?a=1')).body.should == "abc"
|
164
164
|
end
|
165
165
|
|
166
166
|
describe "connecting on Net::HTTP.start" do
|
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: 33
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 1.12.
|
9
|
+
- 3
|
10
|
+
version: 1.12.3
|
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-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: addressable
|