serial-spec 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serial_spec/request_response/helpers.rb +29 -0
- data/lib/serial_spec/request_response.rb +2 -24
- data/lib/serial_spec/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05424a62a53348c145bd4027a5dcd0eb68de6027
|
4
|
+
data.tar.gz: c3dd8520b0ebcbc15442ff8372bc4c6ed6e672b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65cd469da9f7ad8d2981eea0cde26c8ff147fcc5ec5bbea6eb830759514fcdec9c53443526c316902b5633b8fbb8202d8558d9d577259a8e11995e9fb229fb79
|
7
|
+
data.tar.gz: 567a08a3d3f74f82780ca8290edceb022823b6076b8f402201af17164995429e7e059b229b49ad4c3984b16a36363290ae32e615befb6ff174087a2c34402d01
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'serial_spec/parsed_body'
|
3
|
+
|
4
|
+
module SerialSpec
|
5
|
+
module RequestResponse
|
6
|
+
module Helpers
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
def status
|
10
|
+
response.status
|
11
|
+
end
|
12
|
+
|
13
|
+
def headers
|
14
|
+
response.headers
|
15
|
+
end
|
16
|
+
|
17
|
+
def response
|
18
|
+
last_response
|
19
|
+
end
|
20
|
+
|
21
|
+
def body
|
22
|
+
@body ||= begin
|
23
|
+
ParsedBody.new(response.body)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require "rack/test"
|
2
2
|
require "inheritable_accessors/inheritable_hash_accessor"
|
3
|
+
require "serial_spec/request_response/helpers"
|
3
4
|
|
4
5
|
module SerialSpec
|
5
6
|
module RequestResponse
|
6
7
|
extend ActiveSupport::Concern
|
7
8
|
include Rack::Test::Methods
|
8
9
|
include InheritableAccessors::InheritableHashAccessor
|
10
|
+
include Helpers
|
9
11
|
|
10
12
|
included do
|
11
13
|
include ::SerialSpec::RequestResponse::DSL
|
@@ -46,30 +48,6 @@ module SerialSpec
|
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
module Helpers
|
53
|
-
extend ActiveSupport::Concern
|
54
|
-
|
55
|
-
def status
|
56
|
-
response.status
|
57
|
-
end
|
58
|
-
|
59
|
-
def headers
|
60
|
-
response.headers
|
61
|
-
end
|
62
|
-
|
63
|
-
def response
|
64
|
-
last_response
|
65
|
-
end
|
66
|
-
|
67
|
-
def body
|
68
|
-
@body ||= begin
|
69
|
-
JSON.parse(response.body)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
51
|
end
|
74
52
|
|
75
53
|
end
|
data/lib/serial_spec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serial-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Chambers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inheritable_accessors
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- lib/serial_spec/it_expects.rb
|
60
60
|
- lib/serial_spec/parsed_body.rb
|
61
61
|
- lib/serial_spec/request_response.rb
|
62
|
+
- lib/serial_spec/request_response/helpers.rb
|
62
63
|
- lib/serial_spec/version.rb
|
63
64
|
- serial-spec.gemspec
|
64
65
|
homepage: http://github.com/blakechambers/serial-spec
|