Class: Opticon::Tester::Base
- Inherits:
-
Object
- Object
- Opticon::Tester::Base
- Includes:
- HTTP
- Defined in:
- lib/opticon/tester.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#failure ⇒ Object
readonly
Returns the value of attribute failure.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#run(condition) ⇒ Object
Wrapper for calling the test method.
Methods included from HTTP
Instance Attribute Details
#failure ⇒ Object (readonly)
Returns the value of attribute failure.
8 9 10 |
# File 'lib/opticon/tester.rb', line 8 def failure @failure end |
#uri ⇒ Object
Returns the value of attribute uri.
7 8 9 |
# File 'lib/opticon/tester.rb', line 7 def uri @uri end |
Instance Method Details
#run(condition) ⇒ Object
Wrapper for calling the test method. Call this instead of invoking test directly.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/opticon/tester.rb', line 14 def run(condition) begin test(condition) rescue SocketError, TimeoutError, Net::HTTPError, Errno::ECONNREFUSED, Timeout::Error => e @failure = Opticon::Failure::ConnectionFailure.new(uri, condition, nil) @failure.exception = $! false end end |