rspec-webservice-outputter 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rspec-webservice-outputter/base.rb +8 -8
- data/rspec-webservice-outputter.gemspec +3 -3
- data/spec/request_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc0103c4324cf4aa8fdd5c10446b09ac5c4c2694
|
4
|
+
data.tar.gz: 86ddcccc916474893092ba43078753fc31ae4f61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1887bd75a3ce4e21876d4b7bd40d56f33b64a98c6a9c954a51a813a2306749171dbb4d718dc8a88ba343bf1eb3cfb122108a43437d4cd1c736418204fe6c997d
|
7
|
+
data.tar.gz: 25edb5f77a0770f60266cf44c54b16d2d333faac92cb7df3db9b578961f556f200fca2f562df67ee53b39d05b95a27d033466c5af90c5cdfb5c6be15ad4aa824
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
@@ -32,23 +32,23 @@ module RspecWebServiceOutputter
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def to_s
|
35
|
-
"REQUEST:\n"
|
35
|
+
"REQUEST:\n" \
|
36
36
|
"#{@request.method} #{@request.path}#{query_string}\n#{request_body}"
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
41
|
def query_string
|
42
|
-
"?#{@request.query_string}" if @request.query_string
|
42
|
+
"?#{@request.query_string}" if @request.query_string && !@request.query_string.empty?
|
43
43
|
end
|
44
44
|
|
45
45
|
def request_body
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
request_body = @request.body.read
|
47
|
+
return unless request_body && !request_body.empty?
|
48
|
+
begin
|
49
|
+
JSON.pretty_generate(JSON.parse(@request.body.read))
|
50
|
+
rescue
|
51
|
+
"[Non-JSON request body]"
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: rspec-webservice-outputter 0.4.
|
5
|
+
# stub: rspec-webservice-outputter 0.4.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "rspec-webservice-outputter"
|
9
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Nicholas Babb"]
|
14
|
-
s.date = "2018-04-
|
14
|
+
s.date = "2018-04-26"
|
15
15
|
s.email = "ndbabb@gmail.com"
|
16
16
|
s.extra_rdoc_files = [
|
17
17
|
"LICENSE.txt",
|
data/spec/request_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe RspecWebServiceOutputter::Request do
|
|
13
13
|
end
|
14
14
|
let(:request_empty_body) do
|
15
15
|
body = double("body")
|
16
|
-
allow(body).to receive(:read).and_return(
|
16
|
+
allow(body).to receive(:read).and_return('')
|
17
17
|
request = double("request")
|
18
18
|
allow(request).to receive(:method).and_return("POST")
|
19
19
|
allow(request).to receive(:path).and_return("/here-is-a-path")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-webservice-outputter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Babb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|