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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/rack/test/poc.rb +15 -11
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8abaa5a14ca7bf666d2e4f932eccea6145f5d4bf
4
- data.tar.gz: 0272b76fb384693b12fbebf4d20d03b791cf637d
3
+ metadata.gz: 8d220198294349bb3d49c434bbeba924c8f9ce01
4
+ data.tar.gz: 67a0efbbf1be62de73d7c4b93bde7ed5861d0e06
5
5
  SHA512:
6
- metadata.gz: 2e23a6d95d2d78752d54dc5ebe6d8f26186f7a62e1c42d8cec6d28bd43788eda7392074e7289663878ba92419d6879f51547c5678759a932a32f991904f9f8c2
7
- data.tar.gz: 189c0002bccd8768a0f5c2abca38901a5cf6b14111b882a367ad4302518cd0618ce662cc871a6c7491cace7909d4ee69645c5af12351219f5c2da7a4fa566955
6
+ metadata.gz: ef1ce0bebc428efe5e7203d32c4fd5d8f6699873ff53578f21db65f3d26f6fbe1dea64fe842239f8ec684d77160462b1c27dc3436b2d21179c61d24b2bb927a1
7
+ data.tar.gz: 522960eaf67bb133da30d9e2cf47c951272e76772a68720842d4f8004e4010ae1397aa21248905745661f649372a78bc9844bea5c418fafc210a7dba6c7375e4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
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][env['REQUEST_METHOD']] ||= {}
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][env['REQUEST_METHOD']]['response'] ||= {}
73
- RackTestPoc.dump_obj[uri][env['REQUEST_METHOD']]['request'] ||= {}
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][env['REQUEST_METHOD']]['request']['query'] ||= {}
91
- RackTestPoc.dump_obj[uri][env['REQUEST_METHOD']]['request']['query']['raw'] = raw_query
92
- RackTestPoc.dump_obj[uri][env['REQUEST_METHOD']]['request']['query']['object'] = query_hash
93
- RackTestPoc.dump_obj[uri][env['REQUEST_METHOD']]['request']['headers']= env.reduce({}){
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][env['REQUEST_METHOD']]['response']['body'] = body
98
- RackTestPoc.dump_obj[uri][env['REQUEST_METHOD']]['response']['status']= last_response.status
99
- RackTestPoc.dump_obj[uri][env['REQUEST_METHOD']]['response']['format']= format
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][env['REQUEST_METHOD']]['response']['content_type']= env['CONTENT_TYPE']
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.1
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-10-22 00:00:00.000000000 Z
11
+ date: 2014-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler