From b42677d69de3dab1a55c81689cf2b3b45fd85d12 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Fri, 23 Nov 2012 15:46:12 +0000 Subject: Removed duplicate member-variables for subclasses. Allow test-inversion via "must not run". --- lib/custodian/protocoltest/rsync.rb | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'lib/custodian/protocoltest/rsync.rb') 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 -- cgit v1.2.1