airborne 0.3.7 → 0.4.1
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/.github/workflows/tests.yml +67 -0
- data/CHANGELOG.md +22 -1
- data/Gemfile +9 -1
- data/README.md +51 -12
- data/Rakefile +1 -14
- data/airborne.gemspec +2 -2
- data/integration/rails/request_spec.rb +55 -0
- data/integration/rails/spec_helper.rb +35 -0
- data/lib/airborne/base.rb +9 -35
- data/lib/airborne/rack_test_requester.rb +1 -1
- data/lib/airborne/request_expectations.rb +4 -1
- data/lib/airborne/request_methods.rb +33 -0
- data/lib/airborne/response_headers.rb +11 -0
- data/rakelib/changelog.rake +14 -0
- data/rakelib/rspec.rake +3 -0
- data/spec/airborne/base_spec.rb +20 -0
- data/spec/airborne/rack/rack_requester_spec.rb +113 -0
- data/spec/airborne/rack/rack_sinatra_spec.rb +17 -9
- metadata +237 -213
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e82ac09255660ba50383c09a309e13eeafbcbf02c0e6185fc4e9a034aa976043
|
|
4
|
+
data.tar.gz: 25624c608eab8122cedb12b433c267eef09ca36538dad9f3dfd73afd38163f29
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b4ecf6d5a854d54863a2cd53e213baed22b00a9072b31e8769a66e8ca5ee7e832856b580cbc2eb736b3a9a35718b8a3cf437b70193c78fd04d4806c9b1eaaea4
|
|
7
|
+
data.tar.gz: 4ba44d43e8ed37e70e05f591e06060a89ba8efa8cb8cefa0001ca382f06505cdc19b38595e77a04bf7de54719f22231dfde9aebbf5abe5364ed4a62b20246899
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
on:
|
|
2
|
+
pull_request:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- master
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
ruby:
|
|
13
|
+
- '2.7'
|
|
14
|
+
- '3.0'
|
|
15
|
+
- '3.1'
|
|
16
|
+
- '3.2'
|
|
17
|
+
- '3.3'
|
|
18
|
+
- '3.4'
|
|
19
|
+
rack:
|
|
20
|
+
- version: '~> 2.2'
|
|
21
|
+
sinatra: '~> 2.2'
|
|
22
|
+
- version: '~> 3.0'
|
|
23
|
+
sinatra: '~> 4.0'
|
|
24
|
+
|
|
25
|
+
env:
|
|
26
|
+
RACK_VERSION: ${{ matrix.rack.version }}
|
|
27
|
+
SINATRA_VERSION: ${{ matrix.rack.sinatra }}
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: ${{ matrix.ruby }}
|
|
34
|
+
bundler-cache: true
|
|
35
|
+
- run: bundle exec rake
|
|
36
|
+
|
|
37
|
+
rails:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
load_order: [before, after]
|
|
42
|
+
framework:
|
|
43
|
+
- rails: '~> 7.1.0'
|
|
44
|
+
rspec: '~> 6.1'
|
|
45
|
+
rack: '~> 2.2'
|
|
46
|
+
sinatra: '~> 2.2'
|
|
47
|
+
- rails: '~> 7.2.0'
|
|
48
|
+
rspec: '~> 7.1'
|
|
49
|
+
rack: '~> 3.0'
|
|
50
|
+
sinatra: '~> 4.0'
|
|
51
|
+
- rails: '~> 8.1.0'
|
|
52
|
+
rspec: '~> 8.0'
|
|
53
|
+
rack: '~> 3.0'
|
|
54
|
+
sinatra: '~> 4.0'
|
|
55
|
+
env:
|
|
56
|
+
RAILS_VERSION: ${{ matrix.framework.rails }}
|
|
57
|
+
RSPEC_RAILS_VERSION: ${{ matrix.framework.rspec }}
|
|
58
|
+
RACK_VERSION: ${{ matrix.framework.rack }}
|
|
59
|
+
SINATRA_VERSION: ${{ matrix.framework.sinatra }}
|
|
60
|
+
AIRBORNE_LOAD_ORDER: ${{ matrix.load_order }}
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
- uses: ruby/setup-ruby@v1
|
|
64
|
+
with:
|
|
65
|
+
ruby-version: '3.3'
|
|
66
|
+
bundler-cache: true
|
|
67
|
+
- run: bundle exec rspec integration/rails --format progress
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [v0.4.1](https://github.com/brooklynDev/airborne/tree/v0.4.1) (2026-11-24)
|
|
4
|
+
|
|
5
|
+
- Preserve Rails request helpers and response accessors when Airborne is loaded after `rspec-rails`.
|
|
6
|
+
- Add Rails request and controller integration tests in both load orders, including the JSON assertion reported in #167 and consecutive requests.
|
|
7
|
+
- Document Rails request specs and the upgrade needed for the older 0.0.18 JSON-response bug.
|
|
8
|
+
|
|
9
|
+
## [v0.4.0](https://github.com/brooklynDev/airborne/tree/v0.4.0) (2026-11-24)
|
|
10
|
+
|
|
11
|
+
**Rack 3 support:**
|
|
12
|
+
|
|
13
|
+
- Support Rack 3 while retaining compatibility with Rack 2.
|
|
14
|
+
- Accept HTTP header names and underscored symbols in response header lookups and assertions, regardless of case.
|
|
15
|
+
- Preserve array-valued Rack 3 response headers. Header assertions match an individual value in the array.
|
|
16
|
+
- Add regression coverage for request methods, JSON and form bodies, query parameters, response headers, and status assertions.
|
|
17
|
+
- Test Rack 2 and Rack 3 separately in CI, and isolate Sinatra test configuration.
|
|
18
|
+
|
|
19
|
+
**Compatibility changes:**
|
|
20
|
+
|
|
21
|
+
- Require rack-test 2.x; projects pinned to rack-test 1.x must upgrade.
|
|
22
|
+
- Normalize keys returned by `headers.keys` to lowercase names with underscores (for example, `content_type`). Individual lookups also accept HTTP spelling such as `Content-Type`. The original `response.headers` is unchanged.
|
|
23
|
+
|
|
3
24
|
## [v0.3.4](https://github.com/brooklynDev/airborne/tree/v0.3.4) (2019-04-30)
|
|
4
25
|
[Full Changelog](https://github.com/brooklynDev/airborne/compare/v0.3.3...v0.3.4)
|
|
5
26
|
|
|
@@ -455,4 +476,4 @@
|
|
|
455
476
|
## [v0.0.1](https://github.com/brooklynDev/airborne/tree/v0.0.1) (2014-09-16)
|
|
456
477
|
|
|
457
478
|
|
|
458
|
-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
|
479
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile
CHANGED
|
@@ -2,9 +2,17 @@ source 'https://rubygems.org'
|
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
|
+
gem 'rack', ENV['RACK_VERSION'] if ENV['RACK_VERSION']
|
|
6
|
+
|
|
5
7
|
gem 'coveralls', require: false
|
|
8
|
+
gem 'faraday-retry', require: false
|
|
9
|
+
|
|
10
|
+
if ENV['RAILS_VERSION']
|
|
11
|
+
gem 'railties', ENV['RAILS_VERSION']
|
|
12
|
+
gem 'rspec-rails', ENV.fetch('RSPEC_RAILS_VERSION', '>= 0')
|
|
13
|
+
end
|
|
6
14
|
|
|
7
15
|
group :test do
|
|
8
16
|
gem 'webmock'
|
|
9
|
-
gem 'sinatra'
|
|
17
|
+
gem 'sinatra', ENV.fetch('SINATRA_VERSION', '>= 0')
|
|
10
18
|
end
|
data/README.md
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
# Airborne
|
|
2
2
|
|
|
3
|
-
[](http://rubygems.org/gems/airborne)
|
|
3
|
+
[](https://github.com/brooklynDev/airborne/actions/workflows/tests.yml)
|
|
4
|
+
[](https://coveralls.io/github/brooklynDev/airborne?branch=master)
|
|
5
|
+
[](https://rubygems.org/gems/airborne)
|
|
6
|
+
[](https://rubygems.org/gems/airborne)
|
|
7
|
+
[](https://rubygems.org/gems/airborne)
|
|
9
8
|
|
|
10
9
|
RSpec driven API testing framework
|
|
11
10
|
|
|
12
|
-
## Looking for Project Maintainers
|
|
13
|
-
I am looking for project maintainers to help keep airborne up to date and bug-free while avoiding feature creep and maintaining backwards compatibility.
|
|
14
|
-
|
|
15
|
-
Comment [here](https://github.com/brooklynDev/airborne/issues/134) if you would like to help out.
|
|
16
|
-
|
|
17
11
|
## Installation
|
|
18
12
|
|
|
19
13
|
Install Airborne:
|
|
@@ -217,12 +211,57 @@ Airborne.configure do |config|
|
|
|
217
211
|
end
|
|
218
212
|
```
|
|
219
213
|
|
|
220
|
-
Under the covers, Airborne uses [rack-test](https://github.com/
|
|
214
|
+
Under the covers, Airborne uses [rack-test](https://github.com/rack/rack-test) 2.x to make the requests. Rack 2 and Rack 3 are supported.
|
|
215
|
+
|
|
216
|
+
Response header names can be accessed using either HTTP spelling or underscored symbols:
|
|
217
|
+
|
|
218
|
+
```ruby
|
|
219
|
+
headers[:content_type] # same as headers['Content-Type']
|
|
220
|
+
expect_header(:content_type, 'application/json')
|
|
221
|
+
expect_header_contains('Content-Type', 'json')
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Rack 3 can return arrays for repeated response headers, such as `Set-Cookie`.
|
|
225
|
+
Airborne preserves these arrays in `headers`. For an array-valued header,
|
|
226
|
+
`expect_header` matches any complete value and `expect_header_contains` matches
|
|
227
|
+
a substring of any value. Header names and assertion values are case-insensitive.
|
|
228
|
+
|
|
229
|
+
To run the test suite against a specific Rack version:
|
|
230
|
+
|
|
231
|
+
```shell
|
|
232
|
+
RACK_VERSION='~> 2.2' SINATRA_VERSION='~> 2.2' bundle update
|
|
233
|
+
RACK_VERSION='~> 2.2' SINATRA_VERSION='~> 2.2' bundle exec rake
|
|
234
|
+
|
|
235
|
+
RACK_VERSION='~> 3.0' SINATRA_VERSION='~> 4.0' bundle update
|
|
236
|
+
RACK_VERSION='~> 3.0' SINATRA_VERSION='~> 4.0' bundle exec rake
|
|
237
|
+
```
|
|
221
238
|
|
|
222
239
|
## Rails Applications
|
|
223
240
|
|
|
224
241
|
If you're testing an API you've written in Rails, Airborne plays along with `rspec-rails`:
|
|
225
242
|
|
|
243
|
+
Require `airborne` in `rails_helper.rb` alongside `rspec/rails`. Rails request and
|
|
244
|
+
controller specs use Rails' own request helpers and response object; Airborne adds
|
|
245
|
+
JSON, status, and header assertions without requiring a separate server or `base_url`.
|
|
246
|
+
|
|
247
|
+
```ruby
|
|
248
|
+
require 'rails_helper'
|
|
249
|
+
|
|
250
|
+
RSpec.describe 'Users API', type: :request do
|
|
251
|
+
it 'returns an error for a missing user' do
|
|
252
|
+
get '/api/users/1'
|
|
253
|
+
expect_status(:not_found)
|
|
254
|
+
expect_json('error', message: 'not found')
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
If an older installation reports `undefined method '[]' for nil:NilClass`, check
|
|
260
|
+
the Airborne version in `Gemfile.lock` and run `bundle update airborne`. Early
|
|
261
|
+
versions such as 0.0.18 only populated `json_body` after Airborne's own requests;
|
|
262
|
+
current versions parse the Rails response directly, including after consecutive requests.
|
|
263
|
+
|
|
264
|
+
Controller specs are also supported:
|
|
226
265
|
|
|
227
266
|
```ruby
|
|
228
267
|
require 'rails_helper'
|
data/Rakefile
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
|
4
|
-
raise(
|
|
5
|
-
ArgumentError,
|
|
6
|
-
'You need to export CHANGELOG_GITHUB_TOKEN first! You can generate one at: https://github.com/settings/tokens/new'
|
|
7
|
-
) if ENV['CHANGELOG_GITHUB_TOKEN'].nil?
|
|
8
|
-
|
|
9
|
-
config.project = 'airborne'
|
|
10
|
-
|
|
11
|
-
# change this to your github username if you plan to submit a PR with a new CHANGELOG.md
|
|
12
|
-
config.user = 'brooklynDev'
|
|
13
|
-
end
|
|
14
|
-
|
|
1
|
+
task default: [:spec]
|
data/airborne.gemspec
CHANGED
|
@@ -2,7 +2,7 @@ require 'date'
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'airborne'
|
|
5
|
-
s.version = '0.
|
|
5
|
+
s.version = '0.4.1'
|
|
6
6
|
s.date = Date.today.to_s
|
|
7
7
|
s.summary = 'RSpec driven API testing framework'
|
|
8
8
|
s.authors = ['Alex Friedman', 'Seth Pollack']
|
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
s.license = 'MIT'
|
|
13
13
|
s.add_runtime_dependency 'rspec', '~> 3.8'
|
|
14
14
|
s.add_runtime_dependency 'rest-client', '< 3.0', '>= 2.0.2'
|
|
15
|
-
s.add_runtime_dependency 'rack-test', '<
|
|
15
|
+
s.add_runtime_dependency 'rack-test', '< 3', '>= 2.0.0'
|
|
16
16
|
s.add_runtime_dependency 'rack'
|
|
17
17
|
s.add_runtime_dependency 'activesupport'
|
|
18
18
|
s.add_development_dependency 'webmock', '~> 3'
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
require_relative 'spec_helper'
|
|
2
|
+
|
|
3
|
+
RSpec.describe 'Airborne with Rails request specs', type: :request do
|
|
4
|
+
it 'uses Rails requests and assertions against the Rails response (issue #167)' do
|
|
5
|
+
expect(method(:get).owner.name).to start_with('ActionDispatch::')
|
|
6
|
+
get '/api/users/1'
|
|
7
|
+
|
|
8
|
+
expect_json('error', message: 'not found')
|
|
9
|
+
expect_json_types('error', message: :string, id: :string)
|
|
10
|
+
expect_json_keys('error', [:message, :id])
|
|
11
|
+
expect_status(:not_found)
|
|
12
|
+
expect_header_contains(:content_type, 'application/json')
|
|
13
|
+
expect { expect_json('error', message: 'wrong') }.to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'reads the latest response on consecutive Rails requests' do
|
|
17
|
+
get '/api/users/1'
|
|
18
|
+
expect_json('error', id: '1')
|
|
19
|
+
|
|
20
|
+
get '/api/users/2'
|
|
21
|
+
expect_json('error', id: '2')
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'accepts the Rails keyword arguments for JSON requests' do
|
|
25
|
+
post '/api/users', params: { name: 'Alex' }, as: :json
|
|
26
|
+
|
|
27
|
+
expect_status(:created)
|
|
28
|
+
expect_json(name: 'Alex')
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
RSpec.describe 'Airborne requests outside Rails request and controller specs' do
|
|
33
|
+
it 'keeps the Airborne requester available when rspec-rails is loaded' do
|
|
34
|
+
external_response = Struct.new(:code, :headers, :body).new(200, {}, '{"ok":true}')
|
|
35
|
+
allow(RestClient::Request).to receive(:execute).and_return(external_response)
|
|
36
|
+
|
|
37
|
+
expect(method(:get).owner).to eq(Airborne::RequestMethods)
|
|
38
|
+
get 'https://example.test/ping'
|
|
39
|
+
|
|
40
|
+
expect_status(200)
|
|
41
|
+
expect_json(ok: true)
|
|
42
|
+
expect(RestClient::Request).to have_received(:execute).with(hash_including(url: 'https://example.test/ping'))
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
RSpec.describe AirborneRailsIntegration::UsersController, type: :controller do
|
|
47
|
+
it 'uses Rails controller helpers and response accessors' do
|
|
48
|
+
expect(method(:get).owner.name).to start_with('ActionController::')
|
|
49
|
+
get :show, params: { id: '1' }
|
|
50
|
+
|
|
51
|
+
expect_status(404)
|
|
52
|
+
expect_json('error', message: 'not found', id: '1')
|
|
53
|
+
expect_header_contains('Content-Type', 'application/json')
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
ENV['RAILS_ENV'] = 'test'
|
|
2
|
+
|
|
3
|
+
require 'rspec/core'
|
|
4
|
+
require 'airborne' if ENV.fetch('AIRBORNE_LOAD_ORDER', 'before') == 'before'
|
|
5
|
+
require 'rails'
|
|
6
|
+
require 'action_controller/railtie'
|
|
7
|
+
|
|
8
|
+
module AirborneRailsIntegration
|
|
9
|
+
class Application < Rails::Application
|
|
10
|
+
config.root = File.expand_path('../../tmp/rails-app', __dir__)
|
|
11
|
+
config.eager_load = false
|
|
12
|
+
config.secret_key_base = 'airborne-rails-integration-test-secret'
|
|
13
|
+
config.hosts.clear
|
|
14
|
+
config.logger = Logger.new(File::NULL)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class UsersController < ActionController::API
|
|
18
|
+
def show
|
|
19
|
+
render json: { error: { message: 'not found', id: params[:id] } }, status: :not_found
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def create
|
|
23
|
+
render json: { name: params[:name] }, status: :created
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
AirborneRailsIntegration::Application.initialize!
|
|
29
|
+
AirborneRailsIntegration::Application.routes.draw do
|
|
30
|
+
get '/api/users/:id', to: 'airborne_rails_integration/users#show'
|
|
31
|
+
post '/api/users', to: 'airborne_rails_integration/users#create'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
require 'rspec/rails'
|
|
35
|
+
require 'airborne' unless ENV.fetch('AIRBORNE_LOAD_ORDER', 'before') == 'before'
|
data/lib/airborne/base.rb
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
require 'active_support'
|
|
3
3
|
require 'active_support/core_ext/hash/indifferent_access'
|
|
4
|
+
require 'airborne/response_headers'
|
|
5
|
+
require 'airborne/request_methods'
|
|
4
6
|
|
|
5
7
|
module Airborne
|
|
6
8
|
class InvalidJsonError < StandardError; end
|
|
7
9
|
|
|
8
10
|
include RequestExpectations
|
|
9
11
|
|
|
10
|
-
attr_reader :response, :headers, :body
|
|
11
|
-
|
|
12
12
|
def self.configure
|
|
13
13
|
RSpec.configure do |config|
|
|
14
14
|
yield config
|
|
@@ -16,6 +16,12 @@ module Airborne
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def self.included(base)
|
|
19
|
+
# Rails request and controller specs own their request helpers and response.
|
|
20
|
+
if defined?(RSpec::Rails::RequestExampleGroup)
|
|
21
|
+
return if base < RSpec::Rails::RequestExampleGroup || base < RSpec::Rails::ControllerExampleGroup
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
base.send(:include, RequestMethods)
|
|
19
25
|
if !Airborne.configuration.requester_module.nil?
|
|
20
26
|
base.send(:include, Airborne.configuration.requester_module)
|
|
21
27
|
elsif !Airborne.configuration.rack_app.nil?
|
|
@@ -29,40 +35,8 @@ module Airborne
|
|
|
29
35
|
RSpec.configuration
|
|
30
36
|
end
|
|
31
37
|
|
|
32
|
-
def get(url, headers = nil, verify_ssl = base_verify_ssl)
|
|
33
|
-
@response = make_request(:get, url, headers: headers, verify_ssl: verify_ssl)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def post(url, post_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
37
|
-
@response = make_request(:post, url, body: post_body, headers: headers, verify_ssl: verify_ssl)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def patch(url, patch_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
41
|
-
@response = make_request(:patch, url, body: patch_body, headers: headers, verify_ssl: verify_ssl)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def put(url, put_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
45
|
-
@response = make_request(:put, url, body: put_body, headers: headers, verify_ssl: verify_ssl)
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def delete(url, delete_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
49
|
-
@response = make_request(:delete, url, body: delete_body, headers: headers, verify_ssl: verify_ssl)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def head(url, headers = nil)
|
|
53
|
-
@response = make_request(:head, url, headers: headers)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def options(url, headers = nil)
|
|
57
|
-
@response = make_request(:options, url, headers: headers)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def response
|
|
61
|
-
@response
|
|
62
|
-
end
|
|
63
|
-
|
|
64
38
|
def headers
|
|
65
|
-
|
|
39
|
+
ResponseHeaders.new(response.headers.to_h)
|
|
66
40
|
end
|
|
67
41
|
|
|
68
42
|
def body
|
|
@@ -6,7 +6,7 @@ module Airborne
|
|
|
6
6
|
headers = options[:headers] || {}
|
|
7
7
|
base_headers = Airborne.configuration.headers || {}
|
|
8
8
|
headers = base_headers.merge(headers)
|
|
9
|
-
browser = Rack::Test::Session.new(
|
|
9
|
+
browser = Rack::Test::Session.new(Airborne.configuration.rack_app)
|
|
10
10
|
headers.each { |name, value| browser.header(name, value) }
|
|
11
11
|
browser.send(method, url, options[:body] || {}, headers)
|
|
12
12
|
Rack::MockResponse.class_eval do
|
|
@@ -61,7 +61,10 @@ module Airborne
|
|
|
61
61
|
def expect_header_impl(key, content, contains = nil)
|
|
62
62
|
header = headers[key]
|
|
63
63
|
if header
|
|
64
|
-
if
|
|
64
|
+
if header.is_a?(Array)
|
|
65
|
+
expected = contains ? a_string_including(content.downcase) : content.downcase
|
|
66
|
+
expect(header.map(&:downcase)).to include(expected)
|
|
67
|
+
elsif contains
|
|
65
68
|
expect(header.downcase).to include(content.downcase)
|
|
66
69
|
else
|
|
67
70
|
expect(header.downcase).to eq(content.downcase)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Airborne
|
|
2
|
+
module RequestMethods
|
|
3
|
+
attr_reader :response
|
|
4
|
+
|
|
5
|
+
def get(url, headers = nil, verify_ssl = base_verify_ssl)
|
|
6
|
+
@response = make_request(:get, url, headers: headers, verify_ssl: verify_ssl)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def post(url, post_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
10
|
+
@response = make_request(:post, url, body: post_body, headers: headers, verify_ssl: verify_ssl)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def patch(url, patch_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
14
|
+
@response = make_request(:patch, url, body: patch_body, headers: headers, verify_ssl: verify_ssl)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def put(url, put_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
18
|
+
@response = make_request(:put, url, body: put_body, headers: headers, verify_ssl: verify_ssl)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def delete(url, delete_body = nil, headers = nil, verify_ssl = base_verify_ssl)
|
|
22
|
+
@response = make_request(:delete, url, body: delete_body, headers: headers, verify_ssl: verify_ssl)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def head(url, headers = nil)
|
|
26
|
+
@response = make_request(:head, url, headers: headers)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def options(url, headers = nil)
|
|
30
|
+
@response = make_request(:options, url, headers: headers)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'github_changelog_generator/task'
|
|
2
|
+
|
|
3
|
+
if ENV['CHANGELOG_GITHUB_TOKEN'].nil?
|
|
4
|
+
warn '[rake changelog] You need to export CHANGELOG_GITHUB_TOKEN first! You can generate one at: https://github.com/settings/tokens/new'
|
|
5
|
+
return
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
|
9
|
+
config.project = 'airborne'
|
|
10
|
+
|
|
11
|
+
# change this to your github username if you plan to submit a PR with a new CHANGELOG.md
|
|
12
|
+
config.user = 'brooklynDev'
|
|
13
|
+
end
|
|
14
|
+
|
data/rakelib/rspec.rake
ADDED
data/spec/airborne/base_spec.rb
CHANGED
|
@@ -26,6 +26,8 @@ describe 'base spec' do
|
|
|
26
26
|
expect(headers).to be_kind_of(Hash)
|
|
27
27
|
expect(headers[:content_type]).to eq('application/json')
|
|
28
28
|
expect(headers['content_type']).to eq('application/json')
|
|
29
|
+
expect(headers['Content-Type']).to eq('application/json')
|
|
30
|
+
expect(headers['content-type']).to eq('application/json')
|
|
29
31
|
end
|
|
30
32
|
|
|
31
33
|
it 'when request is made body should be set' do
|
|
@@ -34,6 +36,24 @@ describe 'base spec' do
|
|
|
34
36
|
expect(body).to_not be(nil)
|
|
35
37
|
end
|
|
36
38
|
|
|
39
|
+
it 'normalizes mixed-case Rack response headers without changing the response' do
|
|
40
|
+
original_headers = { 'Content-Type' => 'application/json', 'X-Request-ID' => 'request-42' }.freeze
|
|
41
|
+
@response = Struct.new(:headers).new(original_headers)
|
|
42
|
+
|
|
43
|
+
expect(headers[:content_type]).to eq('application/json')
|
|
44
|
+
expect(headers['X-Request-ID']).to eq('request-42')
|
|
45
|
+
expect(headers.fetch(:x_request_id)).to eq('request-42')
|
|
46
|
+
expect(headers.key?('X-REQUEST-ID')).to eq(true)
|
|
47
|
+
expect(response.headers).to eq('Content-Type' => 'application/json', 'X-Request-ID' => 'request-42')
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it 'normalizes headers already wrapped in a hash with indifferent access' do
|
|
51
|
+
@response = Struct.new(:headers).new(HashWithIndifferentAccess.new('Content-Type' => 'application/json'))
|
|
52
|
+
|
|
53
|
+
expect(headers[:content_type]).to eq('application/json')
|
|
54
|
+
expect_header('CONTENT-TYPE', 'application/json')
|
|
55
|
+
end
|
|
56
|
+
|
|
37
57
|
it 'when request is made json body should be symbolized hash' do
|
|
38
58
|
mock_get('simple_get')
|
|
39
59
|
get '/simple_get'
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'rack/lint'
|
|
3
|
+
|
|
4
|
+
describe 'Rack requests' do
|
|
5
|
+
include Airborne::RackTestRequester
|
|
6
|
+
|
|
7
|
+
around do |example|
|
|
8
|
+
previous_app = Airborne.configuration.rack_app
|
|
9
|
+
previous_headers = Airborne.configuration.headers
|
|
10
|
+
Airborne.configuration.headers = {}
|
|
11
|
+
example.run
|
|
12
|
+
ensure
|
|
13
|
+
Airborne.configuration.rack_app = previous_app
|
|
14
|
+
Airborne.configuration.headers = previous_headers
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def rack_app(&block)
|
|
18
|
+
Airborne.configuration.rack_app = Rack::Lint.new(block)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'supports JSON and symbolic status assertions' do
|
|
22
|
+
rack_app { |env| [201, { 'content-type' => 'application/json' }, ['{"id":42}']] }
|
|
23
|
+
|
|
24
|
+
get '/items'
|
|
25
|
+
|
|
26
|
+
expect_status(:created)
|
|
27
|
+
expect_json(id: 42)
|
|
28
|
+
expect_json_types(id: :integer)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'looks up response headers using HTTP names or underscored symbols' do
|
|
32
|
+
rack_app { |env| [200, { 'content-type' => 'application/json' }, ['{}']] }
|
|
33
|
+
|
|
34
|
+
get '/'
|
|
35
|
+
|
|
36
|
+
expect(headers[:content_type]).to eq('application/json')
|
|
37
|
+
expect(headers['content-type']).to eq('application/json')
|
|
38
|
+
expect(headers['Content-Type']).to eq('application/json')
|
|
39
|
+
expect_header(:content_type, 'Application/JSON')
|
|
40
|
+
expect_header('Content-Type', 'application/json')
|
|
41
|
+
expect_header_contains('CONTENT-TYPE', 'JSON')
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'preserves query parameters on GET requests' do
|
|
45
|
+
rack_app do |env|
|
|
46
|
+
[200, { 'content-type' => 'application/json' }, [Rack::Request.new(env).GET.to_json]]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
get '/items?name=hello%20world'
|
|
50
|
+
|
|
51
|
+
expect_json(name: 'hello world')
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
it 'continues to submit hash bodies as form parameters' do
|
|
55
|
+
rack_app do |env|
|
|
56
|
+
[200, { 'content-type' => 'application/json' }, [Rack::Request.new(env).POST.to_json]]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
post '/items', { name: 'hello world' }
|
|
60
|
+
|
|
61
|
+
expect_json(name: 'hello world')
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
[:post, :put, :patch, :delete].each do |verb|
|
|
65
|
+
it "sends a raw JSON body and request headers with #{verb}" do
|
|
66
|
+
rack_app do |env|
|
|
67
|
+
payload = {
|
|
68
|
+
method: env['REQUEST_METHOD'],
|
|
69
|
+
input: env['rack.input'].read,
|
|
70
|
+
content_type: env['CONTENT_TYPE'],
|
|
71
|
+
token: env['HTTP_X_TOKEN'],
|
|
72
|
+
default_header: env['HTTP_X_DEFAULT']
|
|
73
|
+
}
|
|
74
|
+
[200, { 'content-type' => 'application/json' }, [payload.to_json]]
|
|
75
|
+
end
|
|
76
|
+
Airborne.configuration.headers = { 'X-Token' => 'default', 'X-Default' => 'preserved' }
|
|
77
|
+
|
|
78
|
+
send(verb, '/items', '{"name":"test"}', 'Content-Type' => 'application/json', 'X-Token' => 'override')
|
|
79
|
+
|
|
80
|
+
expect_json(method: verb.to_s.upcase, input: '{"name":"test"}',
|
|
81
|
+
content_type: 'application/json', token: 'override', default_header: 'preserved')
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
[:head, :options].each do |verb|
|
|
86
|
+
it "supports #{verb} requests" do
|
|
87
|
+
rack_app { |env| [204, { 'x-method' => env['REQUEST_METHOD'] }, []] }
|
|
88
|
+
|
|
89
|
+
send(verb, '/')
|
|
90
|
+
|
|
91
|
+
expect_status(204)
|
|
92
|
+
expect_header('X-Method', verb.to_s.upcase)
|
|
93
|
+
expect(body).to eq('')
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if Gem::Version.new(Rack.release) >= Gem::Version.new('3.0')
|
|
98
|
+
it 'preserves repeated response headers and matches individual values' do
|
|
99
|
+
rack_app do |env|
|
|
100
|
+
[200, { 'set-cookie' => ['first=one; Path=/', 'second=two; Path=/'] }, ['{}']]
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
get '/'
|
|
104
|
+
|
|
105
|
+
expect(headers[:set_cookie]).to eq(['first=one; Path=/', 'second=two; Path=/'])
|
|
106
|
+
expect_header('Set-Cookie', 'SECOND=TWO; PATH=/')
|
|
107
|
+
expect_header_contains(:set_cookie, 'FIRST=ONE')
|
|
108
|
+
expect { expect_header(:set_cookie, 'missing') }.to raise_error(ExpectationNotMetError)
|
|
109
|
+
expect { expect_header_contains(:set_cookie, 'missing') }.to raise_error(ExpectationNotMetError)
|
|
110
|
+
expect { expect_header(:set_cookie, 'first=one') }.to raise_error(ExpectationNotMetError)
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
1
2
|
require 'json'
|
|
2
3
|
require 'sinatra'
|
|
3
4
|
|
|
4
5
|
class SampleApp < Sinatra::Application
|
|
6
|
+
set :environment, :test
|
|
7
|
+
|
|
5
8
|
before do
|
|
6
9
|
content_type 'application/json'
|
|
7
10
|
end
|
|
@@ -11,11 +14,17 @@ class SampleApp < Sinatra::Application
|
|
|
11
14
|
end
|
|
12
15
|
end
|
|
13
16
|
|
|
14
|
-
Airborne.configure do |config|
|
|
15
|
-
config.rack_app = SampleApp
|
|
16
|
-
end
|
|
17
|
-
|
|
18
17
|
describe 'rack app' do
|
|
18
|
+
include Airborne::RackTestRequester
|
|
19
|
+
|
|
20
|
+
around do |example|
|
|
21
|
+
previous_app = Airborne.configuration.rack_app
|
|
22
|
+
Airborne.configuration.rack_app = SampleApp
|
|
23
|
+
example.run
|
|
24
|
+
ensure
|
|
25
|
+
Airborne.configuration.rack_app = previous_app
|
|
26
|
+
end
|
|
27
|
+
|
|
19
28
|
it 'should allow requests against a sinatra app' do
|
|
20
29
|
get '/'
|
|
21
30
|
expect_json_types(foo: :string)
|
|
@@ -27,17 +36,16 @@ describe 'rack app' do
|
|
|
27
36
|
end
|
|
28
37
|
|
|
29
38
|
it 'Should set json_body even when not using the airborne http requests' do
|
|
30
|
-
|
|
31
|
-
@response = Response.new({ foo: 'bar' }.to_json)
|
|
39
|
+
@response = Struct.new(:body, :headers).new({ foo: 'bar' }.to_json)
|
|
32
40
|
expect(json_body).to eq(foo: 'bar')
|
|
33
41
|
end
|
|
34
42
|
|
|
35
43
|
it 'Should work with consecutive requests' do
|
|
36
|
-
|
|
37
|
-
@response =
|
|
44
|
+
response_class = Struct.new(:body, :headers)
|
|
45
|
+
@response = response_class.new({ foo: 'bar' }.to_json)
|
|
38
46
|
expect(json_body).to eq(foo: 'bar')
|
|
39
47
|
|
|
40
|
-
@response =
|
|
48
|
+
@response = response_class.new({ foo: 'boo' }.to_json)
|
|
41
49
|
expect(json_body).to eq(foo: 'boo')
|
|
42
50
|
end
|
|
43
51
|
end
|
metadata
CHANGED
|
@@ -1,238 +1,262 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: airborne
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Alex Friedman
|
|
8
|
-
- Seth Pollack
|
|
9
|
-
autorequire:
|
|
7
|
+
- Alex Friedman
|
|
8
|
+
- Seth Pollack
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2026-11-24 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
|
-
- !ruby/object:Gem::Dependency
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- !ruby/object:Gem::
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- !ruby/object:Gem::
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
- !ruby/object:Gem::Dependency
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- !ruby/object:Gem::
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: rspec
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
-
|
|
18
|
+
- ~>
|
|
19
|
+
- !ruby/object:Gem::Version
|
|
20
|
+
version: "3.8"
|
|
21
|
+
type: :runtime
|
|
22
|
+
prerelease: false
|
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
24
|
+
requirements:
|
|
25
|
+
-
|
|
26
|
+
- ~>
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: "3.8"
|
|
29
|
+
- !ruby/object:Gem::Dependency
|
|
30
|
+
name: rest-client
|
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
|
32
|
+
requirements:
|
|
33
|
+
-
|
|
34
|
+
- "<"
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: "3.0"
|
|
37
|
+
-
|
|
38
|
+
- ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 2.0.2
|
|
41
|
+
type: :runtime
|
|
42
|
+
prerelease: false
|
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
-
|
|
46
|
+
- "<"
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: "3.0"
|
|
49
|
+
-
|
|
50
|
+
- ">="
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: 2.0.2
|
|
53
|
+
- !ruby/object:Gem::Dependency
|
|
54
|
+
name: rack-test
|
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
-
|
|
58
|
+
- "<"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: "3"
|
|
61
|
+
-
|
|
62
|
+
- ">="
|
|
63
|
+
- !ruby/object:Gem::Version
|
|
64
|
+
version: 2.0.0
|
|
65
|
+
type: :runtime
|
|
66
|
+
prerelease: false
|
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
68
|
+
requirements:
|
|
69
|
+
-
|
|
70
|
+
- "<"
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: "3"
|
|
73
|
+
-
|
|
74
|
+
- ">="
|
|
75
|
+
- !ruby/object:Gem::Version
|
|
76
|
+
version: 2.0.0
|
|
77
|
+
- !ruby/object:Gem::Dependency
|
|
78
|
+
name: rack
|
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
|
80
|
+
requirements:
|
|
81
|
+
-
|
|
82
|
+
- ">="
|
|
83
|
+
- !ruby/object:Gem::Version
|
|
84
|
+
version: "0"
|
|
85
|
+
type: :runtime
|
|
86
|
+
prerelease: false
|
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
88
|
+
requirements:
|
|
89
|
+
-
|
|
90
|
+
- ">="
|
|
91
|
+
- !ruby/object:Gem::Version
|
|
92
|
+
version: "0"
|
|
93
|
+
- !ruby/object:Gem::Dependency
|
|
94
|
+
name: activesupport
|
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
|
96
|
+
requirements:
|
|
97
|
+
-
|
|
98
|
+
- ">="
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: "0"
|
|
101
|
+
type: :runtime
|
|
102
|
+
prerelease: false
|
|
103
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
-
|
|
106
|
+
- ">="
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: "0"
|
|
109
|
+
- !ruby/object:Gem::Dependency
|
|
110
|
+
name: webmock
|
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
|
112
|
+
requirements:
|
|
113
|
+
-
|
|
114
|
+
- ~>
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: "3"
|
|
117
|
+
type: :development
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
-
|
|
122
|
+
- ~>
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: "3"
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: rake
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
-
|
|
130
|
+
- ~>
|
|
131
|
+
- !ruby/object:Gem::Version
|
|
132
|
+
version: "12"
|
|
133
|
+
type: :development
|
|
134
|
+
prerelease: false
|
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
136
|
+
requirements:
|
|
137
|
+
-
|
|
138
|
+
- ~>
|
|
139
|
+
- !ruby/object:Gem::Version
|
|
140
|
+
version: "12"
|
|
141
|
+
- !ruby/object:Gem::Dependency
|
|
142
|
+
name: github_changelog_generator
|
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
|
144
|
+
requirements:
|
|
145
|
+
-
|
|
146
|
+
- ~>
|
|
147
|
+
- !ruby/object:Gem::Version
|
|
148
|
+
version: "1.14"
|
|
149
|
+
type: :development
|
|
150
|
+
prerelease: false
|
|
151
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
152
|
+
requirements:
|
|
153
|
+
-
|
|
154
|
+
- ~>
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: "1.14"
|
|
139
157
|
email:
|
|
140
|
-
- a.friedman07@gmail.com
|
|
141
|
-
- seth@sethpollack.net
|
|
158
|
+
- a.friedman07@gmail.com
|
|
159
|
+
- seth@sethpollack.net
|
|
142
160
|
executables: []
|
|
143
161
|
extensions: []
|
|
144
162
|
extra_rdoc_files: []
|
|
145
163
|
files:
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
- CHANGELOG.md
|
|
153
|
-
- Gemfile
|
|
154
|
-
- LICENSE
|
|
155
|
-
- README.md
|
|
156
|
-
- Rakefile
|
|
157
|
-
- airborne.gemspec
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
- lib/airborne
|
|
161
|
-
- lib/airborne/
|
|
162
|
-
- lib/airborne/
|
|
163
|
-
- lib/airborne/
|
|
164
|
-
- lib/airborne/
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
- spec/airborne/
|
|
172
|
-
- spec/airborne/
|
|
173
|
-
- spec/airborne/
|
|
174
|
-
- spec/airborne/expectations/
|
|
175
|
-
- spec/airborne/expectations/
|
|
176
|
-
- spec/airborne/expectations/
|
|
177
|
-
- spec/airborne/expectations/
|
|
178
|
-
- spec/airborne/expectations/
|
|
179
|
-
- spec/airborne/expectations/
|
|
180
|
-
- spec/airborne/expectations/
|
|
181
|
-
- spec/airborne/expectations/
|
|
182
|
-
- spec/airborne/expectations/
|
|
183
|
-
- spec/airborne/expectations/
|
|
184
|
-
- spec/airborne/expectations/
|
|
185
|
-
- spec/airborne/
|
|
186
|
-
- spec/airborne/
|
|
187
|
-
- spec/airborne/
|
|
188
|
-
- spec/airborne/
|
|
189
|
-
- spec/airborne/
|
|
190
|
-
- spec/airborne/
|
|
191
|
-
- spec/airborne/
|
|
192
|
-
- spec/
|
|
193
|
-
- spec/
|
|
194
|
-
- spec/
|
|
195
|
-
- spec/
|
|
196
|
-
- spec/
|
|
197
|
-
- spec/
|
|
198
|
-
- spec/
|
|
199
|
-
- spec/
|
|
200
|
-
- spec/
|
|
201
|
-
- spec/test_responses/
|
|
202
|
-
- spec/test_responses/
|
|
203
|
-
- spec/test_responses/
|
|
204
|
-
- spec/test_responses/
|
|
205
|
-
- spec/test_responses/
|
|
206
|
-
- spec/test_responses/
|
|
207
|
-
- spec/test_responses/
|
|
208
|
-
- spec/test_responses/
|
|
209
|
-
- spec/test_responses/
|
|
210
|
-
- spec/test_responses/
|
|
211
|
-
- spec/test_responses/
|
|
212
|
-
- spec/test_responses/
|
|
213
|
-
- spec/test_responses/
|
|
214
|
-
- spec/test_responses/
|
|
215
|
-
|
|
164
|
+
- .coveralls.yml
|
|
165
|
+
- .dependabot/config.yml
|
|
166
|
+
- .github/dependabot.yml
|
|
167
|
+
- .github/workflows/tests.yml
|
|
168
|
+
- .gitignore
|
|
169
|
+
- .rspec
|
|
170
|
+
- CHANGELOG.md
|
|
171
|
+
- Gemfile
|
|
172
|
+
- LICENSE
|
|
173
|
+
- README.md
|
|
174
|
+
- Rakefile
|
|
175
|
+
- airborne.gemspec
|
|
176
|
+
- integration/rails/request_spec.rb
|
|
177
|
+
- integration/rails/spec_helper.rb
|
|
178
|
+
- lib/airborne.rb
|
|
179
|
+
- lib/airborne/base.rb
|
|
180
|
+
- lib/airborne/optional_hash_type_expectations.rb
|
|
181
|
+
- lib/airborne/path_matcher.rb
|
|
182
|
+
- lib/airborne/rack_test_requester.rb
|
|
183
|
+
- lib/airborne/request_expectations.rb
|
|
184
|
+
- lib/airborne/request_methods.rb
|
|
185
|
+
- lib/airborne/response_headers.rb
|
|
186
|
+
- lib/airborne/rest_client_requester.rb
|
|
187
|
+
- rakelib/changelog.rake
|
|
188
|
+
- rakelib/rspec.rake
|
|
189
|
+
- spec/airborne/base_spec.rb
|
|
190
|
+
- spec/airborne/client_requester_spec.rb
|
|
191
|
+
- spec/airborne/delete_spec.rb
|
|
192
|
+
- spec/airborne/expectations/expect_header_contains_spec.rb
|
|
193
|
+
- spec/airborne/expectations/expect_header_spec.rb
|
|
194
|
+
- spec/airborne/expectations/expect_json_keys_path_spec.rb
|
|
195
|
+
- spec/airborne/expectations/expect_json_keys_spec.rb
|
|
196
|
+
- spec/airborne/expectations/expect_json_lambda_spec.rb
|
|
197
|
+
- spec/airborne/expectations/expect_json_options_spec.rb
|
|
198
|
+
- spec/airborne/expectations/expect_json_path_spec.rb
|
|
199
|
+
- spec/airborne/expectations/expect_json_regex_spec.rb
|
|
200
|
+
- spec/airborne/expectations/expect_json_sizes_spec.rb
|
|
201
|
+
- spec/airborne/expectations/expect_json_spec.rb
|
|
202
|
+
- spec/airborne/expectations/expect_json_types_date_spec.rb
|
|
203
|
+
- spec/airborne/expectations/expect_json_types_lambda_spec.rb
|
|
204
|
+
- spec/airborne/expectations/expect_json_types_optional_spec.rb
|
|
205
|
+
- spec/airborne/expectations/expect_json_types_options_spec.rb
|
|
206
|
+
- spec/airborne/expectations/expect_json_types_path_spec.rb
|
|
207
|
+
- spec/airborne/expectations/expect_json_types_spec.rb
|
|
208
|
+
- spec/airborne/expectations/expect_status_spec.rb
|
|
209
|
+
- spec/airborne/head_spec.rb
|
|
210
|
+
- spec/airborne/options_spec.rb
|
|
211
|
+
- spec/airborne/patch_spec.rb
|
|
212
|
+
- spec/airborne/path_spec.rb
|
|
213
|
+
- spec/airborne/post_spec.rb
|
|
214
|
+
- spec/airborne/put_spec.rb
|
|
215
|
+
- spec/airborne/rack/rack_requester_spec.rb
|
|
216
|
+
- spec/airborne/rack/rack_sinatra_spec.rb
|
|
217
|
+
- spec/spec_helper.rb
|
|
218
|
+
- spec/stub_helper.rb
|
|
219
|
+
- spec/test_responses/array_of_types.json
|
|
220
|
+
- spec/test_responses/array_of_values.json
|
|
221
|
+
- spec/test_responses/array_response.json
|
|
222
|
+
- spec/test_responses/array_with_index.json
|
|
223
|
+
- spec/test_responses/array_with_nested.json
|
|
224
|
+
- spec/test_responses/array_with_nested_bad_data.json
|
|
225
|
+
- spec/test_responses/array_with_partial_nested.json
|
|
226
|
+
- spec/test_responses/date_is_null_response.json
|
|
227
|
+
- spec/test_responses/date_response.json
|
|
228
|
+
- spec/test_responses/hash_property.json
|
|
229
|
+
- spec/test_responses/invalid_get.json
|
|
230
|
+
- spec/test_responses/invalid_json.json
|
|
231
|
+
- spec/test_responses/numeric_property.json
|
|
232
|
+
- spec/test_responses/simple_delete.json
|
|
233
|
+
- spec/test_responses/simple_get.json
|
|
234
|
+
- spec/test_responses/simple_json.json
|
|
235
|
+
- spec/test_responses/simple_nested_path.json
|
|
236
|
+
- spec/test_responses/simple_patch.json
|
|
237
|
+
- spec/test_responses/simple_path_get.json
|
|
238
|
+
- spec/test_responses/simple_post.json
|
|
239
|
+
- spec/test_responses/simple_put.json
|
|
216
240
|
licenses:
|
|
217
|
-
- MIT
|
|
241
|
+
- MIT
|
|
218
242
|
metadata: {}
|
|
219
|
-
post_install_message:
|
|
220
243
|
rdoc_options: []
|
|
221
244
|
require_paths:
|
|
222
|
-
- lib
|
|
245
|
+
- lib
|
|
223
246
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
224
247
|
requirements:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
248
|
+
-
|
|
249
|
+
- ">="
|
|
250
|
+
- !ruby/object:Gem::Version
|
|
251
|
+
version: "0"
|
|
228
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
253
|
requirements:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
254
|
+
-
|
|
255
|
+
- ">="
|
|
256
|
+
- !ruby/object:Gem::Version
|
|
257
|
+
version: "0"
|
|
233
258
|
requirements: []
|
|
234
|
-
rubygems_version:
|
|
235
|
-
signing_key:
|
|
259
|
+
rubygems_version: 4.1.0
|
|
236
260
|
specification_version: 4
|
|
237
261
|
summary: RSpec driven API testing framework
|
|
238
262
|
test_files: []
|