webspicy 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webspicy/client/rack_test_client.rb +17 -12
- data/lib/webspicy/version.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: 664e519735fcd77f635cd462563320baba79481e
|
4
|
+
data.tar.gz: c1f0002111073477a9503a2df78901f4f6f5cb5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707569be3cf76e783c82610c791f560bde7a849b742342e42f37e867f669966b05fbc44c52de49444a5cfac777480e98cf37d05620768e52e6d8edab6b3df4ac
|
7
|
+
data.tar.gz: ba6f158b152a33d79ab220c08c66d0b1dd2b71fa11d288876d8c53f40cc20f67a74a7428e7eb02433048aee8dfed924281532c50424fed2a3c66ab6e65802497
|
@@ -54,14 +54,14 @@ module Webspicy
|
|
54
54
|
attr_reader :last_response
|
55
55
|
|
56
56
|
def initialize(app)
|
57
|
-
@
|
57
|
+
@app = app
|
58
58
|
end
|
59
|
-
attr_reader :handler
|
60
59
|
|
61
60
|
def get(url, params = {}, headers = nil)
|
62
|
-
|
61
|
+
handler = get_handler(headers)
|
62
|
+
|
63
|
+
Webspicy.info("GET #{url} -- #{params.inspect} -- #{headers.inspect}")
|
63
64
|
|
64
|
-
install_headers(headers) if headers
|
65
65
|
handler.get(url, params)
|
66
66
|
@last_response = handler.last_response
|
67
67
|
|
@@ -70,9 +70,10 @@ module Webspicy
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def post(url, params = {}, headers = nil)
|
73
|
-
|
73
|
+
handler = get_handler(headers)
|
74
|
+
|
75
|
+
Webspicy.info("POST #{url} -- #{params.inspect} -- #{headers.inspect}")
|
74
76
|
|
75
|
-
install_headers(headers) if headers
|
76
77
|
handler.post(url, params.to_json, {"CONTENT_TYPE" => "application/json"})
|
77
78
|
@last_response = handler.last_response
|
78
79
|
|
@@ -81,9 +82,10 @@ module Webspicy
|
|
81
82
|
end
|
82
83
|
|
83
84
|
def post_form(url, params = {}, headers = nil)
|
84
|
-
|
85
|
+
handler = get_handler(headers)
|
86
|
+
|
87
|
+
Webspicy.info("POST #{url} -- #{params.inspect} -- #{headers.inspect}")
|
85
88
|
|
86
|
-
install_headers(headers) if headers
|
87
89
|
handler.post(url, params)
|
88
90
|
@last_response = handler.last_response
|
89
91
|
|
@@ -92,9 +94,10 @@ module Webspicy
|
|
92
94
|
end
|
93
95
|
|
94
96
|
def delete(url, params = {}, headers = nil)
|
95
|
-
|
97
|
+
handler = get_handler(headers)
|
98
|
+
|
99
|
+
Webspicy.info("DELETE #{url} -- #{params.inspect} -- #{headers.inspect}")
|
96
100
|
|
97
|
-
install_headers(headers) if headers
|
98
101
|
handler.delete(url, params.to_json, {"CONTENT_TYPE" => "application/json"})
|
99
102
|
@last_response = handler.last_response
|
100
103
|
|
@@ -104,10 +107,12 @@ module Webspicy
|
|
104
107
|
|
105
108
|
private
|
106
109
|
|
107
|
-
def
|
110
|
+
def get_handler(hs)
|
111
|
+
handler = RackHandler.new(@app)
|
108
112
|
hs.each_pair do |k,v|
|
109
113
|
handler.header(k,v)
|
110
|
-
end
|
114
|
+
end if hs
|
115
|
+
handler
|
111
116
|
end
|
112
117
|
|
113
118
|
end # class Api
|
data/lib/webspicy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webspicy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.
|
177
|
+
rubygems_version: 2.5.1
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: Webspicy helps testing web services as software operation black boxes!
|