From 9939c9f857d63e299a140b0e0dadc1b488129579 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 22 Nov 2012 15:40:07 +0000 Subject: "ftp://ftp.example.com/ must run ftp" + "rsync://...../" are now both permitted. --- TODO | 6 ------ lib/custodian/protocoltest/rsync.rb | 4 ++++ t/test-factory.rb | 5 +++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 2801d25..0b904e0 100644 --- a/TODO +++ b/TODO @@ -8,9 +8,3 @@ Use a class factory to instantiate tests on the worker-side. The HTTP/HTTPS-probe should be pure Ruby. Patrick will give me a stub. - -allow rsync://hostnaem for rsync test - -allow ftp://ftp.uk.mirror.bytarmk.co.uk for ftp test - - diff --git a/lib/custodian/protocoltest/rsync.rb b/lib/custodian/protocoltest/rsync.rb index 8b4e84c..293f67c 100644 --- a/lib/custodian/protocoltest/rsync.rb +++ b/lib/custodian/protocoltest/rsync.rb @@ -52,6 +52,10 @@ module Custodian # Save the host # @host = line.split( /\s+/)[0] + if ( @host =~ /^rsync:\/\/([^\/]+)\/?/ ) + @host = $1.dup + end + # # Save the port diff --git a/t/test-factory.rb b/t/test-factory.rb index 4a941b2..7ef44b1 100755 --- a/t/test-factory.rb +++ b/t/test-factory.rb @@ -47,6 +47,11 @@ class TestTestFactory < Test::Unit::TestCase assert( Custodian::TestFactory.create( "ftp://ftp.example.com/ must run ftp." ).target() == "ftp.example.com" ) + + assert( Custodian::TestFactory.create( "rsync.example.com must run rsync." ).target() == "rsync.example.com" ) + assert( Custodian::TestFactory.create( "rsync://rsync.example.com/ must run rsync." ).target() == "rsync.example.com" ) + + end -- cgit v1.2.1