spaceborne 0.1.20 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef96cf9468ca3c758684d8cd8c6290bfe014fcd9
4
- data.tar.gz: 28f6d52112ea5cce9fa3af86846232e121c1eaf4
3
+ metadata.gz: 5efd85c470ba6cc01806761449631cf025c8c292
4
+ data.tar.gz: bd6a6120ed5496efc901d2d0e9adb23682bc49b6
5
5
  SHA512:
6
- metadata.gz: 779ad03d9c73643b403407966d5d22c30e9b44d7b2aa004e942e3b859db627a48f07be4c42c4dba47d3f4cf1700164a51ab5d1f8029c15018596592d019ace7a
7
- data.tar.gz: e72b1a9fef03f8e90798be9293ab2b57d97d1fb85c3bb36e71bac7feccdcc126ef2f03f348c064275f0840f96d2be9e9c8354b73ef98a59d9c144b0120b5adfb
6
+ metadata.gz: a99e989c2bb0620be367e6c02e4d70301c97f6480343a78ae5703f20d4e8bf2da47f5176db333ac3c9b2bf07153d569a7eba406b0175b5c793276d069b28fe69
7
+ data.tar.gz: 67b291bcb88be8c825f3e4d452e23ed572a86c8b617ad94ab90c4a153d103e3084fb363c43f017c9d0e5d263f612ecd2c2f1be130f641ce82019d706d656f4f2
data/README.md CHANGED
@@ -89,7 +89,7 @@ describe 'simple get sample' do
89
89
  end
90
90
  end
91
91
  ```
92
- The parts of the example outside of the wrap_request block are typical rspec. The wrap_request is a spaceborne concept, saying that if anything fails inside of the block, to ouput to stdout information about the request, and response. This is to work around the issue of an expectation failing, and having good info about why, but having no idea what the request or response were that caused the failure. The actual request is done on the get line. Validation of the response is the following expect_ lines.
92
+ The parts of the example outside of the `wrap_request` block are typical rspec. The `wrap_request` is a spaceborne concept, saying that if anything fails inside of that block, then the failure contains the request, response, as well as why it failed. This is to work around the issue of an expectation failing, and having good info about why, but having no idea what the request or response were that caused the failure. The actual request is done on the `get` line. Validation of the response is the following `expect_*` lines.
93
93
 
94
94
  #### Parts of response to validate
95
95
 
@@ -198,9 +198,9 @@ Validation for headers follows the same pattern as above, although nesting of mu
198
198
  ## Extensions to Airborne
199
199
 
200
200
  1. Uses curlyrest to allow extension of rest-client with curl requests
201
- 2. Uses wrap_request to bundle groups of expectations so that if any fail, you will actually see the request and response printed out, rather than just seeing the expectation that failed
202
- 3. json_body is only parsed once after a request rather than on each expect call
203
- 4. Expectations for headers use the same form as the expectations for json bodies
201
+ 2. Uses wrap_request to bundle groups of expectations so that if any fail, the failure will contain the request and response, rather than just seeing the expectation that failed
202
+ 3. json_body is only parsed once after a request rather than on each expect call (spaceborne resets the body on a new http request).
203
+ 4. Expectations for headers use the same form as the expectations for json bodies.
204
204
  * `expect_header same arguments/handling as expect_json`
205
205
  * `expect_header_types same arguments/handling as expect_json_types`
206
206
  5. It is possible to use non-json data in a request
@@ -221,7 +221,7 @@ The following example shows how this works
221
221
  }
222
222
  }
223
223
  ```
224
- You can now validate the fact that each element in the collection has a key which is variant, but a value that has a defined format (first and last are strings).
224
+ You can now validate the fact that each element in the collection has a key which is variant, but a value that has a defined format (the first and last field values are strings).
225
225
 
226
226
  expect_json_types('array_of_hashes.*.*', first: :string, last: :string)
227
227
  expect_json_types('hash_of_hashes.*', first: :string, last: :string)
data/lib/spaceborne.rb CHANGED
@@ -7,8 +7,8 @@ require 'json'
7
7
  # module for apitesting with spaceborne
8
8
  module Spaceborne
9
9
  def json?(headers)
10
- headers.key?(:content_type) &&
11
- headers[:content_type].include?('application/json')
10
+ headers.key?('Content-Type') &&
11
+ headers['Content-Type'].include?('application/json')
12
12
  end
13
13
 
14
14
  def add_time
@@ -127,7 +127,7 @@ module Airborne
127
127
  private
128
128
 
129
129
  def base_headers
130
- { content_type: 'application/json' }
130
+ { "Content-Type" => 'application/json' }
131
131
  .merge(Airborne.configuration.headers || {})
132
132
  end
133
133
  end
@@ -1,3 +1,3 @@
1
1
  module Spaceborne
2
- VERSION = '0.1.20'.freeze
2
+ VERSION = '0.1.21'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceborne
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keith Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-07 00:00:00.000000000 Z
11
+ date: 2019-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport