flexirest 1.7.5 → 1.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -0
- data/lib/flexirest/request.rb +5 -1
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/request_spec.rb +8 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1d623cd3e54c69cc619786ce8c462434491ef7b3985d4323e22401d861c7e2ed
|
4
|
+
data.tar.gz: 65d440f279dbe3bb452d9f7dcbdc5eee171dc3a62ee3fa0973256041b37d0841
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd94c74ad17f1fad4a39f2888934d98add27fc7bcb79ebdcbdb14872e167d1fa90c9a76274da8d5ea771fa4e4e62711daeded34494ac12ab60068faa643e3ad4
|
7
|
+
data.tar.gz: 750b9fa6f4d5c86d56d465f11d8b9d653667e4c0bd1ba189b9f2bd3eab3e77534bb348d8e2c6ebc6a47c9e70117b25f86d30718487c592adb873c5d25d91526e
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/request.rb
CHANGED
@@ -817,7 +817,11 @@ module Flexirest
|
|
817
817
|
|
818
818
|
def message
|
819
819
|
method = @method.try(:upcase)
|
820
|
-
"
|
820
|
+
"The #{method} to '#{@request_url}' returned a #{@status} status, which raised a #{self.class.to_s} with a body of: #{@raw_response}"
|
821
|
+
end
|
822
|
+
|
823
|
+
def to_s
|
824
|
+
message
|
821
825
|
end
|
822
826
|
end
|
823
827
|
class HTTPClientException < HTTPException ; end
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/request_spec.rb
CHANGED
@@ -249,6 +249,13 @@ describe Flexirest::Request do
|
|
249
249
|
ExampleClient.all debug:true
|
250
250
|
end
|
251
251
|
|
252
|
+
it "should correctly serialise array parameters" do
|
253
|
+
# name: ["john", "bill"] should become name[]=john&name[]=bill (but URL-safe so %5B%5D)
|
254
|
+
expect_any_instance_of(Flexirest::Connection).to receive(:get).with("/?name%5B%5D=john&name%5B%5D=bill", an_instance_of(Hash)).
|
255
|
+
and_return(::FaradayResponseMock.new(OpenStruct.new(body:'{"result":true}', response_headers:{})))
|
256
|
+
ExampleClient.all name: ["john", "bill"]
|
257
|
+
end
|
258
|
+
|
252
259
|
it "should pass through get parameters, using defaults specified" do
|
253
260
|
expect_any_instance_of(Flexirest::Connection).to receive(:get).with("/defaults?overwrite=yes&persist=yes", an_instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:'{"result":true}', response_headers:{})))
|
254
261
|
ExampleClient.defaults overwrite:"yes"
|
@@ -753,6 +760,7 @@ describe Flexirest::Request do
|
|
753
760
|
rescue Flexirest::HTTPClientException => e
|
754
761
|
e
|
755
762
|
end
|
763
|
+
expect(e.to_s).to eq("The POST to '/create' returned a 409 status, which raised a Flexirest::HTTPConflictClientException with a body of: {\"first_name\":\"John\", \"id\":1234}")
|
756
764
|
expect(e).to be_a(Flexirest::HTTPClientException)
|
757
765
|
expect(e).to be_instance_of(Flexirest::HTTPConflictClientException)
|
758
766
|
expect(e.status).to eq(409)
|
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.7.
|
4
|
+
version: 1.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -347,8 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
347
347
|
- !ruby/object:Gem::Version
|
348
348
|
version: '0'
|
349
349
|
requirements: []
|
350
|
-
|
351
|
-
rubygems_version: 2.6.13
|
350
|
+
rubygems_version: 3.0.1
|
352
351
|
signing_key:
|
353
352
|
specification_version: 4
|
354
353
|
summary: This gem is for accessing REST services in a flexible way. ActiveResource
|