From 7d153d8f22fc767108103cd8fdfc056e2656b914 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 21 Nov 2012 23:15:44 +0000 Subject: Added .to_json method to serialize our tests. --- lib/custodian/protocoltest/ftp.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/custodian/protocoltest/ftp.rb') diff --git a/lib/custodian/protocoltest/ftp.rb b/lib/custodian/protocoltest/ftp.rb index 8894de0..1d60e43 100644 --- a/lib/custodian/protocoltest/ftp.rb +++ b/lib/custodian/protocoltest/ftp.rb @@ -59,6 +59,20 @@ class FTPTest < TCPTest # + # Convert this class to JSON such that it may be serialized. + # + def to_json + hash = { + :test_type => 'ftp', + :test_target => @host, + :test_port => @port, + } + hash.to_json + end + + + + # Run the TCP-protocol test. # def run_test -- cgit v1.2.1