summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/rsync.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-23 15:46:12 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-23 15:46:12 +0000
commit19ad4dc151720b6d172e2f3dabf11cce933ba18d (patch)
tree3c17d871d9ba42496ff23f05522b99bd43bcb7bb /lib/custodian/protocoltest/rsync.rb
parentcd1750251483f82cafdfb8e6a92242097b4929c4 (diff)
Removed duplicate member-variables for subclasses.
Allow test-inversion via "must not run".
Diffstat (limited to 'lib/custodian/protocoltest/rsync.rb')
-rw-r--r--lib/custodian/protocoltest/rsync.rb30
1 files changed, 10 insertions, 20 deletions
diff --git a/lib/custodian/protocoltest/rsync.rb b/lib/custodian/protocoltest/rsync.rb
index 293f67c..3d38d3a 100644
--- a/lib/custodian/protocoltest/rsync.rb
+++ b/lib/custodian/protocoltest/rsync.rb
@@ -18,25 +18,6 @@ module Custodian
class RSYNCTest < TCPTest
- #
- # The line from which we were constructed.
- #
- attr_reader :line
-
-
- #
- # The host to test against.
- #
- attr_reader :host
-
-
- #
- # The port to connect to.
- #
- attr_reader :port
-
-
-
#
# Constructor
@@ -49,13 +30,22 @@ module Custodian
@line = line
#
- # Save the host
+ # If the target is an URL then strip to the hostname.
#
@host = line.split( /\s+/)[0]
if ( @host =~ /^rsync:\/\/([^\/]+)\/?/ )
@host = $1.dup
end
+ #
+ # Is this test inverted?
+ #
+ if ( line =~ /must\s+not\s+run\s+/ )
+ @inverted = true
+ else
+ @inverted = false
+ end
+
#
# Save the port