summaryrefslogtreecommitdiff
path: root/t/test-custodian-testfactory.rb
diff options
context:
space:
mode:
Diffstat (limited to 't/test-custodian-testfactory.rb')
-rwxr-xr-xt/test-custodian-testfactory.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/test-custodian-testfactory.rb b/t/test-custodian-testfactory.rb
index 9aeb6e1..db79f50 100755
--- a/t/test-custodian-testfactory.rb
+++ b/t/test-custodian-testfactory.rb
@@ -137,6 +137,36 @@ class TestTestFactory < Test::Unit::TestCase
assert( Custodian::TestFactory.create( "ftp://example.com/ must not run rsync." ) )
assert( Custodian::TestFactory.create( "ftp://example.com/ must not run rsync on 333." ) )
end
+
+
+ #
+ # Test some inversions
+ #
+ data = {
+ "foo must run rsync." => false,
+ "rsync://foo/ must run rsync." => false,
+ "foo must run ping otherwise" => false,
+ "foo must not run ping otherwise" => true,
+ "foo must not run ssh otherwise" => true,
+ "foo must not run ldap otherwise" => true,
+ }
+
+ #
+ # Run each test
+ #
+ data.each do |str,inv|
+ assert_nothing_raised do
+
+ obj = Custodian::TestFactory.create( str )
+
+ #
+ # Ensure we got the object, and the port was correct.
+ #
+ assert(obj, "created object via TestFactory.create('#{str}')")
+ assert( obj.inverted() == inv, "#{str} -> #{inv}" )
+ end
+ end
+
end
end