flexirest 1.7.5 → 1.7.6

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
- SHA1:
3
- metadata.gz: cc25c4790b42d7d6c5f17f1bccf38af464ae9acc
4
- data.tar.gz: 851bdde04eb58f1e9b38753fd8c6ad72324c92d8
2
+ SHA256:
3
+ metadata.gz: 1d623cd3e54c69cc619786ce8c462434491ef7b3985d4323e22401d861c7e2ed
4
+ data.tar.gz: 65d440f279dbe3bb452d9f7dcbdc5eee171dc3a62ee3fa0973256041b37d0841
5
5
  SHA512:
6
- metadata.gz: '0179fd825262037792935e82e26c86d262c4d3675410850fc05aeefb37b72e8d620b60e6e245487825e50aa69cae40e4e2e13020b40704b856fb61e025dbaeec'
7
- data.tar.gz: 79aa3524f59de9ff2932d2ee07c69170bb281031ba393551fe6dbe63f3ae5583dff88c93e6ecce0a4e7110afbb1750808bbe78fec9efe625667c702559699da4
6
+ metadata.gz: cd94c74ad17f1fad4a39f2888934d98add27fc7bcb79ebdcbdb14872e167d1fa90c9a76274da8d5ea771fa4e4e62711daeded34494ac12ab60068faa643e3ad4
7
+ data.tar.gz: 750b9fa6f4d5c86d56d465f11d8b9d653667e4c0bd1ba189b9f2bd3eab3e77534bb348d8e2c6ebc6a47c9e70117b25f86d30718487c592adb873c5d25d91526e
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.6
4
+
5
+ Feature:
6
+
7
+ - Changed `Flexirest::HTTPException#message` and `#to_s` for a better description of the error than just the class name.
8
+
3
9
  ## 1.7.5
4
10
 
5
11
  Feature:
@@ -817,7 +817,11 @@ module Flexirest
817
817
 
818
818
  def message
819
819
  method = @method.try(:upcase)
820
- "Sending #{method} to '#{@request_url}' returned a #{@status} with the body of - #{@raw_response}"
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
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.7.5"
2
+ VERSION = "1.7.6"
3
3
  end
@@ -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.5
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-01-03 00:00:00.000000000 Z
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
- rubyforge_project:
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