webtester 0.2.2 → 0.2.3
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/assertion.rb +1 -1
- data/lib/request.rb +6 -7
- data/lib/test.rb +1 -1
- 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: 2ca25e0b290d3603f18a2f0060f49872f5fe918e
|
4
|
+
data.tar.gz: c98ff6ae020c404b09254faad17e5e79b7d231e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96a1f9d88719481eada2d78758b663261ba290164a294df8480cd8c3f65906d9bad7d8bd4030bb1340558c41cadfa84c535f74c5ac0bd0dafc5c668c1ab74bb5
|
7
|
+
data.tar.gz: 8716d060ec773733ff7137027578952a9148de29d78da7fde40001143e93636b660ae7f2b4df29b361b800c371a7786bf8bb30b0ae1fe0866f03acf283dc4b1a
|
data/lib/assertion.rb
CHANGED
data/lib/request.rb
CHANGED
@@ -16,6 +16,7 @@ module WT
|
|
16
16
|
attr_accessor :headers
|
17
17
|
attr_accessor :proxy_host
|
18
18
|
attr_accessor :proxy_port
|
19
|
+
attr_accessor :read_timeout
|
19
20
|
|
20
21
|
def initialize(request_type, request_url, request_data = {})
|
21
22
|
self.request_type = request_type
|
@@ -24,6 +25,7 @@ module WT
|
|
24
25
|
self.headers = {}
|
25
26
|
self.proxy_host = nil
|
26
27
|
self.proxy_port = 0
|
28
|
+
self.read_timeout = 15
|
27
29
|
end
|
28
30
|
|
29
31
|
def exec
|
@@ -91,9 +93,9 @@ module WT
|
|
91
93
|
response = nil
|
92
94
|
ssl = (self.request_protocol == 'https')
|
93
95
|
options = if ssl
|
94
|
-
{ :use_ssl => true, :verify_mode => OpenSSL::SSL::VERIFY_NONE }
|
96
|
+
{ :use_ssl => true, :verify_mode => OpenSSL::SSL::VERIFY_NONE, :read_timeout => self.read_timeout }
|
95
97
|
else
|
96
|
-
{}
|
98
|
+
{ :read_timeout => self.read_timeout }
|
97
99
|
end
|
98
100
|
|
99
101
|
if self.proxy_host
|
@@ -110,18 +112,15 @@ module WT
|
|
110
112
|
end
|
111
113
|
end
|
112
114
|
|
113
|
-
|
114
|
-
|
115
|
+
WT::Log.debug("\t* WT::Result.new(self, response): #{response.code}") if response
|
115
116
|
ret = WT::Result.new(self, response)
|
116
117
|
|
117
|
-
WT::Log.debug("\t* WT::Result.new(self, response): #{response.code}")
|
118
|
-
|
119
118
|
rescue Exception => e
|
120
119
|
WT::Log.error("\t* Exception: #{e.message}")
|
121
120
|
ret = WT::Result.new self, nil
|
122
121
|
end
|
123
122
|
|
124
|
-
WT::Log.debug("<< WT::Request::send -> #{ret.response.code}")
|
123
|
+
WT::Log.debug("<< WT::Request::send -> #{ret.response.code}") if response
|
125
124
|
|
126
125
|
return ret
|
127
126
|
end
|
data/lib/test.rb
CHANGED
@@ -54,7 +54,7 @@ module WT
|
|
54
54
|
begin
|
55
55
|
result = session.request(step[:request], false)
|
56
56
|
|
57
|
-
WT::Log.debug("\t * assertion.assert(#{result.response.code})")
|
57
|
+
WT::Log.debug("\t * assertion.assert(#{result.response.code})") if result.response
|
58
58
|
step[:assertion].assert(result.response)
|
59
59
|
rescue Exception => ex
|
60
60
|
result = WT::Result.new(step[:request], nil, nil) unless result
|