summaryrefslogtreecommitdiff
path: root/t
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 /t
parentcd1750251483f82cafdfb8e6a92242097b4929c4 (diff)
Removed duplicate member-variables for subclasses.
Allow test-inversion via "must not run".
Diffstat (limited to 't')
-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