webtester 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/request.rb +9 -9
- data/lib/test.rb +6 -2
- data/lib/web_session.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 324876a5e91c34470e62213bd59e91cf302c778d
|
4
|
+
data.tar.gz: 755c266e7e89a3a0afd385d5faced240c7d70129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7833ff68aa8f6dc4560b12ecbdbf6dfb346ee5750571ebee3fe23f9acfd7ef36bf62890628a8b975d1e328fd6aab80d4e84c16f3e5e337138a700c7b2ab6e0c
|
7
|
+
data.tar.gz: b72ce344ae3fa1b29035fef936a0f5a3d15acab090fc9f362b8571bfd2948e8a7a53f31f7103c90c7c81495ece69dbe68326a0395385ad343559c75cca726365
|
data/lib/request.rb
CHANGED
@@ -16,12 +16,12 @@ module WT
|
|
16
16
|
attr_accessor :proxy_port
|
17
17
|
|
18
18
|
def initialize(request_type, request_url, request_data = {})
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
self.request_type = request_type
|
20
|
+
self.request_url = request_url
|
21
|
+
self.request_data = request_data
|
22
|
+
self.headers = {}
|
23
|
+
self.proxy_host = nil
|
24
|
+
self.proxy_port = 0
|
25
25
|
end
|
26
26
|
|
27
27
|
def exec
|
@@ -85,9 +85,9 @@ module WT
|
|
85
85
|
|
86
86
|
http = nil
|
87
87
|
|
88
|
-
if
|
89
|
-
WT::Log.debug("\t* @proxy_host = #{
|
90
|
-
http = Net::HTTP
|
88
|
+
if self.proxy_host
|
89
|
+
WT::Log.debug("\t* @proxy_host = #{self.proxy_host}, proxy_port = #{self.proxy_port}")
|
90
|
+
http = Net::HTTP.new(self.proxy_host, self.proxy_port)
|
91
91
|
else
|
92
92
|
WT::Log.debug("\t* Net::HTTP.new(#{host_ip}, #{port})")
|
93
93
|
http = Net::HTTP.new(host_ip, port)
|
data/lib/test.rb
CHANGED
@@ -72,10 +72,14 @@ module WT
|
|
72
72
|
def self.request_from_yaml(yaml_request)
|
73
73
|
type = yaml_request['type']
|
74
74
|
url = yaml_request['url']
|
75
|
-
body = {}
|
76
|
-
|
75
|
+
body = yaml_request['body'] || {}
|
76
|
+
|
77
|
+
proxy_parts = yaml_request['proxy'].split(':') if yaml_request['proxy']
|
77
78
|
|
78
79
|
request = WT::Request.new(type, url, body)
|
80
|
+
request.proxy_host = proxy_parts[0]
|
81
|
+
request.proxy_port = proxy_parts[1]
|
82
|
+
request
|
79
83
|
end
|
80
84
|
|
81
85
|
def self.assertion_from_yaml(yaml_response)
|
data/lib/web_session.rb
CHANGED