rspec-webservice-outputter 0.1.0
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 +7 -0
- data/.document +5 -0
- data/.rspec +1 -0
- data/.rubocop.yml +2 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +108 -0
- data/LICENSE.txt +20 -0
- data/README.md +62 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/lib/rspec_configuration.rb +8 -0
- data/lib/rspec_webservice_outputter.rb +80 -0
- data/spec/output_spec.rb +18 -0
- data/spec/request_spec.rb +60 -0
- data/spec/response_spec.rb +42 -0
- data/spec/spec_helper.rb +2 -0
- metadata +158 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 102e6bb89cb79ca071e9adfd282c1c234a8ad393
|
4
|
+
data.tar.gz: 5b4708ed56dd994f2b53081215ea25dbc95b371b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1960fb4efb98d500f008372b03592fa8a0e8c0471f30bad98c05172d00893256d6b3b15e710580074e9faab091c316611778ea0fcb04d1fa57bbd016d78b175c
|
7
|
+
data.tar.gz: 3cf372fc49f59de8df40313a82a9ed13e8fd43ccb56f089358dc037fa6cc3b2a094529d40e26170ca5b4db56c50c0d3918cc6ad04228969797053da6e7ea13fc
|
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
gem "rspec", ">= 2.0"
|
4
|
+
gem "activesupport", ">= 3.0"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "rdoc", "~> 3.12"
|
10
|
+
gem "bundler", "~> 1.0"
|
11
|
+
gem "juwelier", "~> 2.1.0"
|
12
|
+
gem "simplecov", ">= 0.11"
|
13
|
+
gem "rubocop"
|
14
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (4.2.6)
|
5
|
+
i18n (~> 0.7)
|
6
|
+
json (~> 1.7, >= 1.7.7)
|
7
|
+
minitest (~> 5.1)
|
8
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
9
|
+
tzinfo (~> 1.1)
|
10
|
+
addressable (2.4.0)
|
11
|
+
ast (2.3.0)
|
12
|
+
builder (3.2.2)
|
13
|
+
descendants_tracker (0.0.4)
|
14
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
15
|
+
diff-lcs (1.2.5)
|
16
|
+
docile (1.1.5)
|
17
|
+
faraday (0.9.2)
|
18
|
+
multipart-post (>= 1.2, < 3)
|
19
|
+
git (1.3.0)
|
20
|
+
github_api (0.14.0)
|
21
|
+
addressable (~> 2.4.0)
|
22
|
+
descendants_tracker (~> 0.0.4)
|
23
|
+
faraday (~> 0.8, < 0.10)
|
24
|
+
hashie (>= 3.4)
|
25
|
+
oauth2
|
26
|
+
hashie (3.4.4)
|
27
|
+
highline (1.7.8)
|
28
|
+
i18n (0.7.0)
|
29
|
+
json (1.8.3)
|
30
|
+
juwelier (2.1.2)
|
31
|
+
builder
|
32
|
+
bundler (>= 1.0)
|
33
|
+
git (>= 1.2.5)
|
34
|
+
github_api
|
35
|
+
highline (>= 1.6.15)
|
36
|
+
nokogiri (>= 1.5.10)
|
37
|
+
rake
|
38
|
+
rdoc
|
39
|
+
semver
|
40
|
+
jwt (1.5.1)
|
41
|
+
mini_portile2 (2.1.0)
|
42
|
+
minitest (5.9.0)
|
43
|
+
multi_json (1.12.1)
|
44
|
+
multi_xml (0.5.5)
|
45
|
+
multipart-post (2.0.0)
|
46
|
+
nokogiri (1.6.8)
|
47
|
+
mini_portile2 (~> 2.1.0)
|
48
|
+
pkg-config (~> 1.1.7)
|
49
|
+
oauth2 (1.1.0)
|
50
|
+
faraday (>= 0.8, < 0.10)
|
51
|
+
jwt (~> 1.0, < 1.5.2)
|
52
|
+
multi_json (~> 1.3)
|
53
|
+
multi_xml (~> 0.5)
|
54
|
+
rack (>= 1.2, < 3)
|
55
|
+
parser (2.3.1.2)
|
56
|
+
ast (~> 2.2)
|
57
|
+
pkg-config (1.1.7)
|
58
|
+
powerpack (0.1.1)
|
59
|
+
rack (1.6.4)
|
60
|
+
rainbow (2.1.0)
|
61
|
+
rake (11.1.2)
|
62
|
+
rdoc (3.12.2)
|
63
|
+
json (~> 1.4)
|
64
|
+
rspec (3.2.0)
|
65
|
+
rspec-core (~> 3.2.0)
|
66
|
+
rspec-expectations (~> 3.2.0)
|
67
|
+
rspec-mocks (~> 3.2.0)
|
68
|
+
rspec-core (3.2.0)
|
69
|
+
rspec-support (~> 3.2.0)
|
70
|
+
rspec-expectations (3.2.0)
|
71
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
72
|
+
rspec-support (~> 3.2.0)
|
73
|
+
rspec-mocks (3.2.0)
|
74
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
75
|
+
rspec-support (~> 3.2.0)
|
76
|
+
rspec-support (3.2.0)
|
77
|
+
rubocop (0.40.0)
|
78
|
+
parser (>= 2.3.1.0, < 3.0)
|
79
|
+
powerpack (~> 0.1)
|
80
|
+
rainbow (>= 1.99.1, < 3.0)
|
81
|
+
ruby-progressbar (~> 1.7)
|
82
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
83
|
+
ruby-progressbar (1.8.1)
|
84
|
+
semver (1.0.1)
|
85
|
+
simplecov (0.11.2)
|
86
|
+
docile (~> 1.1.0)
|
87
|
+
json (~> 1.8)
|
88
|
+
simplecov-html (~> 0.10.0)
|
89
|
+
simplecov-html (0.10.0)
|
90
|
+
thread_safe (0.3.5)
|
91
|
+
tzinfo (1.2.2)
|
92
|
+
thread_safe (~> 0.1)
|
93
|
+
unicode-display_width (1.0.5)
|
94
|
+
|
95
|
+
PLATFORMS
|
96
|
+
ruby
|
97
|
+
|
98
|
+
DEPENDENCIES
|
99
|
+
activesupport (>= 3.0)
|
100
|
+
bundler (~> 1.0)
|
101
|
+
juwelier (~> 2.1.0)
|
102
|
+
rdoc (~> 3.12)
|
103
|
+
rspec (>= 2.0)
|
104
|
+
rubocop
|
105
|
+
simplecov (>= 0.11)
|
106
|
+
|
107
|
+
BUNDLED WITH
|
108
|
+
1.10.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2016 Nicholas Babb
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# rspec-webservice-outputter
|
2
|
+
|
3
|
+
Developing a JSON API in Rails? The rspec-webservice-outputter gem will print the JSON request/response data when running your rspec request specs.
|
4
|
+
|
5
|
+
There are some other tools for inspecting HTTP request/response data such as the Chrome DevTools or the Postman Chrome extension. This gem takes a different approach by providing a method to inspect the HTTP request/response from the command-line when running/debugging tests.
|
6
|
+
|
7
|
+
# Installation
|
8
|
+
|
9
|
+
In your Rails Gemfile, add:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
group :test do
|
13
|
+
gem 'rspec-webservice-outputter'
|
14
|
+
end
|
15
|
+
```
|
16
|
+
|
17
|
+
# Usage
|
18
|
+
|
19
|
+
When running your request spec(s), set an environmental variable call WEBSERVICE:
|
20
|
+
|
21
|
+
```
|
22
|
+
WEBSERVICE=1 rspec path_to_your_spec.rb
|
23
|
+
```
|
24
|
+
|
25
|
+
The rspec example's output will look like:
|
26
|
+
|
27
|
+
```
|
28
|
+
REQUEST:
|
29
|
+
POST /v1/some_url
|
30
|
+
{
|
31
|
+
"some_field": 5,
|
32
|
+
"another_field": "2016-06-08"
|
33
|
+
}
|
34
|
+
|
35
|
+
RESPONSE (201):
|
36
|
+
{
|
37
|
+
"id": 55,
|
38
|
+
"some_field": 5,
|
39
|
+
"another_field": "2016-06-08"
|
40
|
+
"created_at": "2016-06-09T01:35:41.709Z",
|
41
|
+
"updated_at": "2016-06-09T01:35:41.709Z"
|
42
|
+
}
|
43
|
+
```
|
44
|
+
|
45
|
+
If your response body is empty (e.g. 204 No Content), you'll see:
|
46
|
+
|
47
|
+
```
|
48
|
+
RESPONSE (204):
|
49
|
+
[Empty response body]
|
50
|
+
```
|
51
|
+
|
52
|
+
If your response body's JSON data can't be parsed, you'll see:
|
53
|
+
|
54
|
+
```
|
55
|
+
RESPONSE (200):
|
56
|
+
[Non-JSON response body]
|
57
|
+
```
|
58
|
+
|
59
|
+
# Future Possibilities
|
60
|
+
- Explore ways of implementing as a rspec custom formatter instead of an after hook
|
61
|
+
- Or, toggle output via switch instead of env variable
|
62
|
+
- Support XML webservices
|
data/Rakefile
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'juwelier'
|
15
|
+
Juwelier::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = "rspec-webservice-outputter"
|
18
|
+
gem.homepage = "http://github.com/ndbabb/rspec-webservice-outputter"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = "Outputs webservice request/response JSON data for rails rspec request specs"
|
21
|
+
#gem.description = "Outputs the webservice request/response JSON data of rspec functional specs"
|
22
|
+
gem.email = "ndbabb@gmail.com"
|
23
|
+
gem.authors = ["Nicholas Babb"]
|
24
|
+
|
25
|
+
# dependencies defined in Gemfile
|
26
|
+
end
|
27
|
+
Juwelier::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
require 'rspec/core'
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Code coverage detail"
|
36
|
+
task :simplecov do
|
37
|
+
ENV['COVERAGE'] = "true"
|
38
|
+
Rake::Task['spec'].execute
|
39
|
+
end
|
40
|
+
|
41
|
+
task :default => :spec
|
42
|
+
|
43
|
+
require 'rdoc/task'
|
44
|
+
Rake::RDocTask.new do |rdoc|
|
45
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
46
|
+
|
47
|
+
rdoc.rdoc_dir = 'rdoc'
|
48
|
+
rdoc.title = "rspec-webservice-outputter #{version}"
|
49
|
+
rdoc.rdoc_files.include('README*')
|
50
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
51
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'active_support/core_ext/object/blank'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
module RspecWebServiceOutputter
|
5
|
+
class Output
|
6
|
+
def initialize(action_dispatch_request, action_dispatch_response)
|
7
|
+
@action_dispatch_request = action_dispatch_request
|
8
|
+
@action_dispatch_response = action_dispatch_response
|
9
|
+
end
|
10
|
+
|
11
|
+
def print
|
12
|
+
puts self
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
"\n#{request}\n\n#{response}\n\n"
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def request
|
22
|
+
Request.new(@action_dispatch_request)
|
23
|
+
end
|
24
|
+
|
25
|
+
def response
|
26
|
+
Response.new(@action_dispatch_response)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class Request
|
31
|
+
def initialize(request)
|
32
|
+
@request = request
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_s
|
36
|
+
"REQUEST:\n" +
|
37
|
+
"#{@request.method} #{@request.path}#{query_string}\n#{request_body}"
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def query_string
|
43
|
+
"?#{@request.query_string}" if @request.query_string.present?
|
44
|
+
end
|
45
|
+
|
46
|
+
def request_body
|
47
|
+
if @request.body.read.present?
|
48
|
+
begin
|
49
|
+
JSON.pretty_generate(JSON.parse(@request.body.read))
|
50
|
+
rescue
|
51
|
+
"[Non-JSON request body]"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class Response
|
58
|
+
def initialize(response)
|
59
|
+
@response = response
|
60
|
+
end
|
61
|
+
|
62
|
+
def to_s
|
63
|
+
"RESPONSE (#{@response.code}):\n#{response_body}"
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def response_body
|
69
|
+
if @response.body.present?
|
70
|
+
begin
|
71
|
+
JSON.pretty_generate(JSON.parse(@response.body))
|
72
|
+
rescue
|
73
|
+
"[Non-JSON response body]"
|
74
|
+
end
|
75
|
+
else
|
76
|
+
"[Empty response body]"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/spec/output_spec.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RspecWebServiceOutputter::Output do
|
4
|
+
context "to_s" do
|
5
|
+
it 'returns string with the request and response' do
|
6
|
+
request = double("request")
|
7
|
+
response = double("response")
|
8
|
+
outputter = RspecWebServiceOutputter::Output.new(request, response)
|
9
|
+
allow(outputter).to receive(:request).and_return("Request Output")
|
10
|
+
allow(outputter).to receive(:response).and_return("Response Output")
|
11
|
+
output = outputter.to_s.split("\n")
|
12
|
+
expect(output[0]).to eq("")
|
13
|
+
expect(output[1]).to eq("Request Output")
|
14
|
+
expect(output[2]).to eq("")
|
15
|
+
expect(output[3]).to eq("Response Output")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RspecWebServiceOutputter::Request do
|
4
|
+
let(:request_with_body) do
|
5
|
+
body = double("body")
|
6
|
+
allow(body).to receive(:read).and_return('{"test": "test"}')
|
7
|
+
request = double("request")
|
8
|
+
allow(request).to receive(:method).and_return("POST")
|
9
|
+
allow(request).to receive(:path).and_return("/here-is-a-path")
|
10
|
+
allow(request).to receive(:query_string).and_return("key1=value1&key2=value2")
|
11
|
+
allow(request).to receive(:body).and_return(body)
|
12
|
+
return request
|
13
|
+
end
|
14
|
+
let(:request_empty_body) do
|
15
|
+
body = double("body")
|
16
|
+
allow(body).to receive(:read).and_return(nil)
|
17
|
+
request = double("request")
|
18
|
+
allow(request).to receive(:method).and_return("POST")
|
19
|
+
allow(request).to receive(:path).and_return("/here-is-a-path")
|
20
|
+
allow(request).to receive(:query_string).and_return("key1=value1&key2=value2")
|
21
|
+
allow(request).to receive(:body).and_return(body)
|
22
|
+
return request
|
23
|
+
end
|
24
|
+
let(:request_with_non_json) do
|
25
|
+
body = double("body")
|
26
|
+
allow(body).to receive(:read).and_return('some non-json text')
|
27
|
+
request = double("request")
|
28
|
+
allow(request).to receive(:method).and_return("POST")
|
29
|
+
allow(request).to receive(:path).and_return("/here-is-a-path")
|
30
|
+
allow(request).to receive(:query_string).and_return("key1=value1&key2=value2")
|
31
|
+
allow(request).to receive(:body).and_return(body)
|
32
|
+
return request
|
33
|
+
end
|
34
|
+
context "to_s" do
|
35
|
+
it 'returns string that starts with REQUEST:' do
|
36
|
+
output = RspecWebServiceOutputter::Request.new(request_empty_body).to_s.split("\n")
|
37
|
+
expect(output[0]).to eq("REQUEST:")
|
38
|
+
end
|
39
|
+
it 'returns string with request summary (method, path and query string)' do
|
40
|
+
output = RspecWebServiceOutputter::Request.new(request_empty_body).to_s.split("\n")
|
41
|
+
expect(output[1]).to eq("POST /here-is-a-path?key1=value1&key2=value2")
|
42
|
+
end
|
43
|
+
it 'returns string with request body when present' do
|
44
|
+
output = RspecWebServiceOutputter::Request.new(request_with_body).to_s.split("\n")
|
45
|
+
expect(output[2]).to eq("{")
|
46
|
+
expect(output[3]).to eq(" \"test\": \"test\"")
|
47
|
+
expect(output[4]).to eq("}")
|
48
|
+
end
|
49
|
+
it 'returns only the request summary when no request body' do
|
50
|
+
output = RspecWebServiceOutputter::Request.new(request_empty_body).to_s.split("\n")
|
51
|
+
expect(output[0]).to eq("REQUEST:")
|
52
|
+
expect(output[1]).to eq("POST /here-is-a-path?key1=value1&key2=value2")
|
53
|
+
expect(output.size).to eq(2)
|
54
|
+
end
|
55
|
+
it 'returns [Non-JSON request body] when non-empty non-JSON in body' do
|
56
|
+
output = RspecWebServiceOutputter::Request.new(request_with_non_json).to_s.split("\n")
|
57
|
+
expect(output[2]).to eq("[Non-JSON request body]")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RspecWebServiceOutputter::Response do
|
4
|
+
let(:response_with_body) do
|
5
|
+
response = double("response")
|
6
|
+
allow(response).to receive(:code).and_return("204")
|
7
|
+
allow(response).to receive(:body).and_return('{"test": "test"}')
|
8
|
+
return response
|
9
|
+
end
|
10
|
+
let(:response_empty_body) do
|
11
|
+
response = double("response")
|
12
|
+
allow(response).to receive(:code).and_return("204")
|
13
|
+
allow(response).to receive(:body).and_return(nil)
|
14
|
+
return response
|
15
|
+
end
|
16
|
+
let(:response_with_non_json) do
|
17
|
+
response = double("response")
|
18
|
+
allow(response).to receive(:code).and_return("204")
|
19
|
+
allow(response).to receive(:body).and_return("Some non-JSON text")
|
20
|
+
return response
|
21
|
+
end
|
22
|
+
context "to_s" do
|
23
|
+
it 'returns string that starts with RESPONSE([status_code]):' do
|
24
|
+
output = RspecWebServiceOutputter::Response.new(response_with_body).to_s.split("\n")
|
25
|
+
expect(output[0]).to eq("RESPONSE (204):")
|
26
|
+
end
|
27
|
+
it 'returns string with response body when present' do
|
28
|
+
output = RspecWebServiceOutputter::Response.new(response_with_body).to_s.split("\n")
|
29
|
+
expect(output[1]).to eq("{")
|
30
|
+
expect(output[2]).to eq(" \"test\": \"test\"")
|
31
|
+
expect(output[3]).to eq("}")
|
32
|
+
end
|
33
|
+
it 'returns [Empty response body] when no response body' do
|
34
|
+
output = RspecWebServiceOutputter::Response.new(response_empty_body).to_s.split("\n")
|
35
|
+
expect(output[1]).to eq("[Empty response body]")
|
36
|
+
end
|
37
|
+
it 'returns [Non-JSON response body] when non-empty non-JSON in body' do
|
38
|
+
output = RspecWebServiceOutputter::Response.new(response_with_non_json).to_s.split("\n")
|
39
|
+
expect(output[1]).to eq("[Non-JSON response body]")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,158 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec-webservice-outputter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nicholas Babb
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rdoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.12'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.12'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: juwelier
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.1.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.1.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.11'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.11'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description:
|
112
|
+
email: ndbabb@gmail.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files:
|
116
|
+
- LICENSE.txt
|
117
|
+
- README.md
|
118
|
+
files:
|
119
|
+
- ".document"
|
120
|
+
- ".rspec"
|
121
|
+
- ".rubocop.yml"
|
122
|
+
- Gemfile
|
123
|
+
- Gemfile.lock
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- VERSION
|
128
|
+
- lib/rspec_configuration.rb
|
129
|
+
- lib/rspec_webservice_outputter.rb
|
130
|
+
- spec/output_spec.rb
|
131
|
+
- spec/request_spec.rb
|
132
|
+
- spec/response_spec.rb
|
133
|
+
- spec/spec_helper.rb
|
134
|
+
homepage: http://github.com/ndbabb/rspec-webservice-outputter
|
135
|
+
licenses:
|
136
|
+
- MIT
|
137
|
+
metadata: {}
|
138
|
+
post_install_message:
|
139
|
+
rdoc_options: []
|
140
|
+
require_paths:
|
141
|
+
- lib
|
142
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
requirements: []
|
153
|
+
rubyforge_project:
|
154
|
+
rubygems_version: 2.4.5
|
155
|
+
signing_key:
|
156
|
+
specification_version: 4
|
157
|
+
summary: Outputs webservice request/response JSON data for rails rspec request specs
|
158
|
+
test_files: []
|