rack-test-poc 1.0.1 → 1.0.2
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/rack/test/poc.rb +15 -11
- 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: 8d220198294349bb3d49c434bbeba924c8f9ce01
|
4
|
+
data.tar.gz: 67a0efbbf1be62de73d7c4b93bde7ed5861d0e06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef1ce0bebc428efe5e7203d32c4fd5d8f6699873ff53578f21db65f3d26f6fbe1dea64fe842239f8ec684d77160462b1c27dc3436b2d21179c61d24b2bb927a1
|
7
|
+
data.tar.gz: 522960eaf67bb133da30d9e2cf47c951272e76772a68720842d4f8004e4010ae1397aa21248905745661f649372a78bc9844bea5c418fafc210a7dba6c7375e4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/lib/rack/test/poc.rb
CHANGED
@@ -42,8 +42,10 @@ module RackTestPoc
|
|
42
42
|
|
43
43
|
super
|
44
44
|
|
45
|
+
request_method_str = env['REQUEST_METHOD'].to_s.upcase
|
46
|
+
|
45
47
|
RackTestPoc.dump_obj[uri] ||= {}
|
46
|
-
RackTestPoc.dump_obj[uri][
|
48
|
+
RackTestPoc.dump_obj[uri][request_method_str] ||= {}
|
47
49
|
|
48
50
|
begin
|
49
51
|
|
@@ -69,8 +71,8 @@ module RackTestPoc
|
|
69
71
|
|
70
72
|
end
|
71
73
|
|
72
|
-
RackTestPoc.dump_obj[uri][
|
73
|
-
RackTestPoc.dump_obj[uri][
|
74
|
+
RackTestPoc.dump_obj[uri][request_method_str]['response'] ||= {}
|
75
|
+
RackTestPoc.dump_obj[uri][request_method_str]['request'] ||= {}
|
74
76
|
|
75
77
|
raw_query = env.find{|k,v|
|
76
78
|
%W[ QUERY_STRING rack.request.form_vars ].any?{|tag| k == tag && !v.nil? && v != '' }
|
@@ -87,19 +89,21 @@ module RackTestPoc
|
|
87
89
|
|
88
90
|
end
|
89
91
|
|
90
|
-
RackTestPoc.dump_obj[uri][
|
91
|
-
RackTestPoc.dump_obj[uri][
|
92
|
-
RackTestPoc.dump_obj[uri][
|
93
|
-
RackTestPoc.dump_obj[uri][
|
92
|
+
RackTestPoc.dump_obj[uri][request_method_str]['request']['query'] ||= {}
|
93
|
+
RackTestPoc.dump_obj[uri][request_method_str]['request']['query']['raw'] = raw_query
|
94
|
+
RackTestPoc.dump_obj[uri][request_method_str]['request']['query']['object'] = query_hash
|
95
|
+
RackTestPoc.dump_obj[uri][request_method_str]['request']['headers']= env.reduce({}){
|
94
96
|
|m,o| m.merge!(o[0]=>o[1]) if o[0].to_s.downcase =~ /^http_/ ; m
|
95
97
|
}
|
96
98
|
|
97
|
-
RackTestPoc.dump_obj[uri][
|
98
|
-
RackTestPoc.dump_obj[uri][
|
99
|
-
|
99
|
+
RackTestPoc.dump_obj[uri][request_method_str]['response']['body'] = body
|
100
|
+
RackTestPoc.dump_obj[uri][request_method_str]['response']['raw_body'] = last_response.body
|
101
|
+
|
102
|
+
RackTestPoc.dump_obj[uri][request_method_str]['response']['status']= last_response.status
|
103
|
+
RackTestPoc.dump_obj[uri][request_method_str]['response']['format']= format
|
100
104
|
|
101
105
|
if env['CONTENT_TYPE']
|
102
|
-
RackTestPoc.dump_obj[uri][
|
106
|
+
RackTestPoc.dump_obj[uri][request_method_str]['response']['content_type']= env['CONTENT_TYPE']
|
103
107
|
|
104
108
|
end
|
105
109
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-test-poc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|