diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-04-16 16:14:06 +0100 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-04-16 16:14:06 +0100 |
commit | 91713ef347d49dca7de7dd9360d42763dd961894 (patch) | |
tree | 99f8d3e0ff368cc7bb863cdf7910ffcc629774d4 /lib/custodian/protocoltest/openproxy.rb | |
parent | 1b9654c79d6bd8e24134ddeef4bf44580a726178 (diff) |
Updated test-handler for new API.
This update consists of two changes:
* No longer return "true" or "false" instead return "TEST_FAILED", or "TEST_SUCCEEDED".
* Removed the testing of test-inversion from the class, now it lives in the base-class where it should have done all along.
Diffstat (limited to 'lib/custodian/protocoltest/openproxy.rb')
-rw-r--r-- | lib/custodian/protocoltest/openproxy.rb | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/custodian/protocoltest/openproxy.rb b/lib/custodian/protocoltest/openproxy.rb index 07f608f..d3acfaa 100644 --- a/lib/custodian/protocoltest/openproxy.rb +++ b/lib/custodian/protocoltest/openproxy.rb @@ -1,5 +1,6 @@ - require 'custodian/settings' +require 'custodian/testfactory' + require 'uri' @@ -41,14 +42,6 @@ module Custodian # @host = line.split(/\s+/)[0] - # - # Is this test inverted? - # - if line =~ /must\s+not\s+run\s+/ - @inverted = true - else - @inverted = false - end end @@ -112,9 +105,9 @@ module Custodian return false end end - rescue Timeout::Error => e + rescue Timeout::Error => _e @error = 'Timed out during fetch.' - return false + return Custodian::TestResult::TEST_FAILED end # @@ -122,10 +115,10 @@ module Custodian # got a result. # if (@status.to_i == 200) - return true + return Custodian::TestResult::TEST_PASSED else - @error = "Proxy fetch of http://google.com/ via #{@host} failed" - return false + @error = "Proxy fetch of http://google.com/ via #{@host} failed" + return Custodian::TestResult::TEST_FAILED end end |