diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-22 06:49:21 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-22 06:49:21 +0000 |
commit | c796e1fd3c4b6c659255b3a814662d4377836ed0 (patch) | |
tree | 8b4d9feb4403c842af29451de35aa5f94836d70b /lib/custodian/protocoltest/http.rb | |
parent | 3ac252151c374e067425dd7efe355bd76ba122d1 (diff) |
Moved tests into a namespace.
Diffstat (limited to 'lib/custodian/protocoltest/http.rb')
-rw-r--r-- | lib/custodian/protocoltest/http.rb | 112 |
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 |