flexirest 1.3.1 → 1.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/flexirest/connection.rb +2 -1
- data/lib/flexirest/request.rb +1 -1
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/connection_spec.rb +3 -3
- data/spec/lib/proxy_spec.rb +1 -1
- data/spec/lib/request_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc944642eeec80748c437111eb7e7b5b5ee98d40
|
|
4
|
+
data.tar.gz: f931c97b2a77159732a14e78e69f125ef006cd69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72e1f0677d501933a37699452787dc2f7a43ee7919c94e362b6daf6f7eb1b5fd0fe65c5c7cd8254d90a1c9c2027ddbd4fa26151205f2976de7074421e7b9d1b4
|
|
7
|
+
data.tar.gz: 86f2aa14d43f8d16a3bdc69824e443eedb30ee6e645c402898d0dab9e0d41514f0ac26ae30acabecc90d599507fb9f19f85db0b2681d9be90b4fee3f5c300964
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/connection.rb
CHANGED
|
@@ -81,12 +81,13 @@ module Flexirest
|
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
def delete(path, options={})
|
|
84
|
+
def delete(path, data, options={})
|
|
85
85
|
set_defaults(options)
|
|
86
86
|
make_safe_request(path) do
|
|
87
87
|
@session.delete(path) do |req|
|
|
88
88
|
set_per_request_timeout(req, options) if options[:timeout]
|
|
89
89
|
req.headers = req.headers.merge(options[:headers])
|
|
90
|
+
req.body = data
|
|
90
91
|
sign_request(req, options[:api_auth])
|
|
91
92
|
end
|
|
92
93
|
end
|
data/lib/flexirest/request.rb
CHANGED
|
@@ -350,7 +350,7 @@ module Flexirest
|
|
|
350
350
|
when :patch
|
|
351
351
|
response = connection.patch(@url, @body, request_options)
|
|
352
352
|
when :delete
|
|
353
|
-
response = connection.delete(@url, request_options)
|
|
353
|
+
response = connection.delete(@url, @body, request_options)
|
|
354
354
|
else
|
|
355
355
|
raise InvalidRequestException.new("Invalid method #{http_method}")
|
|
356
356
|
end
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/connection_spec.rb
CHANGED
|
@@ -45,8 +45,8 @@ describe Flexirest::Connection do
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
it "should pass a DELETE request through to Faraday" do
|
|
48
|
-
stub_request(:delete, "www.example.com/foo").to_return(body: "{result:true}")
|
|
49
|
-
result = @connection.delete("/foo")
|
|
48
|
+
stub_request(:delete, "www.example.com/foo").with(body: "body").to_return(body: "{result:true}")
|
|
49
|
+
result = @connection.delete("/foo", "body")
|
|
50
50
|
expect(result.body).to eq("{result:true}")
|
|
51
51
|
end
|
|
52
52
|
|
|
@@ -102,7 +102,7 @@ describe Flexirest::Connection do
|
|
|
102
102
|
with(:headers => @default_headers).
|
|
103
103
|
to_return(body: "{result:true}")
|
|
104
104
|
|
|
105
|
-
result = @connection.delete("/foo")
|
|
105
|
+
result = @connection.delete("/foo", "body")
|
|
106
106
|
expect(result.body).to eq("{result:true}")
|
|
107
107
|
end
|
|
108
108
|
end
|
data/spec/lib/proxy_spec.rb
CHANGED
|
@@ -113,7 +113,7 @@ describe Flexirest::Base do
|
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
it "handles DELETE requests" do
|
|
116
|
-
expect_any_instance_of(Flexirest::Connection).to receive(:delete).with("/remove", instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:"{\"result\":true}", status:200, response_headers:{})))
|
|
116
|
+
expect_any_instance_of(Flexirest::Connection).to receive(:delete).with("/remove", "", instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:"{\"result\":true}", status:200, response_headers:{})))
|
|
117
117
|
ProxyClientExample.remove
|
|
118
118
|
end
|
|
119
119
|
|
data/spec/lib/request_spec.rb
CHANGED
|
@@ -104,7 +104,7 @@ describe Flexirest::Request do
|
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
it "should get an HTTP connection when called and call delete on it" do
|
|
107
|
-
expect_any_instance_of(Flexirest::Connection).to receive(:delete).with("/remove/1", an_instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:'{"result":true}', response_headers:{})))
|
|
107
|
+
expect_any_instance_of(Flexirest::Connection).to receive(:delete).with("/remove/1", "", an_instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:'{"result":true}', response_headers:{})))
|
|
108
108
|
ExampleClient.remove(id:1)
|
|
109
109
|
end
|
|
110
110
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flexirest
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Jeffries
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-02-
|
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|