summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/http.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/custodian/protocoltest/http.rb')
-rw-r--r--lib/custodian/protocoltest/http.rb112
1 files changed, 59 insertions, 53 deletions
diff --git a/lib/custodian/protocoltest/http.rb b/lib/custodian/protocoltest/http.rb
index fa97223..1610698 100644
--- a/lib/custodian/protocoltest/http.rb
+++ b/lib/custodian/protocoltest/http.rb
@@ -9,89 +9,95 @@
###
#
#
-class HTTPTest < TestFactory
+module Custodian
+ module ProtocolTest
- #
- # The line from which we were constructed.
- #
- attr_reader :line
+ class HTTPTest < TestFactory
- #
- # The URL to poll
- #
- attr_reader :url
+ #
+ # The line from which we were constructed.
+ #
+ attr_reader :line
- #
- # Constructor
- #
- def initialize( line )
- #
- # Save the line
- #
- @line = line
+ #
+ # The URL to poll
+ #
+ attr_reader :url
- #
- # Save the URL
- #
- @url = line.split( /\s+/)[0]
+ #
+ # Constructor
+ #
+ def initialize( line )
+ #
+ # Save the line
+ #
+ @line = line
- if ( @url !~ /^https?:/ )
- raise ArgumentError, "The target wasn't an URL"
- end
+ #
+ # Save the URL
+ #
+ @url = line.split( /\s+/)[0]
- end
+ if ( @url !~ /^https?:/ )
+ raise ArgumentError, "The target wasn't an URL"
+ end
+ end
- #
- # Helper for development.
- #
- def to_s
- "http-test of #{@url}."
- end
+ #
+ # Helper for development.
+ #
+ def to_s
+ "http-test of #{@url}."
+ end
- #
- # Convert this class to JSON such that it may be serialized.
- #
- def to_json
- hash = { :line => @line }
- hash.to_json
- end
+ #
+ # Convert this class to JSON such that it may be serialized.
+ #
+ def to_json
+ hash = { :line => @line }
+ hash.to_json
+ end
- #
- # Run the test.
- #
- def run_test
- @error = "Not implemented"
- false
- end
+ #
+ # Run the test.
+ #
+ def run_test
+ @error = "Not implemented"
+ false
+ end
- #
- # If the test fails then report the error.
- #
- def error
- @error
- end
+
+
+ #
+ # If the test fails then report the error.
+ #
+ def error
+ @error
+ end
- register_test_type "http"
- register_test_type "https"
+ register_test_type "http"
+ register_test_type "https"
+ end
+ end
end