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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 429bb7365ea2e47cfb103859a61de99e9ec466ab
4
- data.tar.gz: 1e66cd581083a9611809501d2b5c44e581b08679
3
+ metadata.gz: 2ca25e0b290d3603f18a2f0060f49872f5fe918e
4
+ data.tar.gz: c98ff6ae020c404b09254faad17e5e79b7d231e2
5
5
  SHA512:
6
- metadata.gz: ed434569b32dc128d04e0251853a3f42927d114c3b8e3f847de28e021551022fda8f967f4a8bd1fa0e5f14be5dcefa3491ff1b2344b04f132ba6f06903a994bf
7
- data.tar.gz: c4e02a17fd98b33303a4994e503f9869d7ed70b36523e2cb10b56e731987bb5d1c02d3112137c21b6e801164985afa6804570bda935102607f452730e3e76903
6
+ metadata.gz: 96a1f9d88719481eada2d78758b663261ba290164a294df8480cd8c3f65906d9bad7d8bd4030bb1340558c41cadfa84c535f74c5ac0bd0dafc5c668c1ab74bb5
7
+ data.tar.gz: 8716d060ec773733ff7137027578952a9148de29d78da7fde40001143e93636b660ae7f2b4df29b361b800c371a7786bf8bb30b0ae1fe0866f03acf283dc4b1a
@@ -168,7 +168,7 @@ module WT
168
168
 
169
169
  class ResponseNotFoundException < Exception
170
170
  def initialize
171
- super("Response not found. Probably there is some connection issue.")
171
+ super("Response not found. Probably there was some connection issue.")
172
172
  end
173
173
  end
174
174
 
@@ -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
- raise "Could not connect to host: #{host}:#{port}" unless response
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
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webtester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego F. Nascimento