summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/smtp.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-21 23:15:44 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-21 23:15:44 +0000
commit7d153d8f22fc767108103cd8fdfc056e2656b914 (patch)
treef56a9b3b97fb623d836d70363f84f913f1584011 /lib/custodian/protocoltest/smtp.rb
parent1e03e807d496d2c3cf92ff3429fe8d95427eb64c (diff)
Added .to_json method to serialize our tests.
Diffstat (limited to 'lib/custodian/protocoltest/smtp.rb')
-rw-r--r--lib/custodian/protocoltest/smtp.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/custodian/protocoltest/smtp.rb b/lib/custodian/protocoltest/smtp.rb
index 3a38f5a..dce5ddf 100644
--- a/lib/custodian/protocoltest/smtp.rb
+++ b/lib/custodian/protocoltest/smtp.rb
@@ -59,6 +59,21 @@ class SMTPTest < TCPTest
#
+ # Convert this class to JSON such that it may be serialized.
+ #
+ def to_json
+ hash = {
+ :test_type => 'smtp',
+ :test_target => @host,
+ :test_port => @port,
+ }
+ hash.to_json
+ end
+
+
+
+
+ #
# Run the TCP-protocol test.
#
def run_test