summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-01-29 09:38:01 +0000
committerSteve Kemp <steve@steve.org.uk>2015-01-29 09:38:01 +0000
commit5e4cbcbf100de85981dc8318059aeec7e3f2a5b5 (patch)
tree81c07a8a8bdf22f15c66116b99028fb82189a7be /t
parent78a461e4acf10733f22f06afbecd302ddbc83a78 (diff)
Added simple test cases
Diffstat (limited to 't')
-rwxr-xr-xt/test-custodian-queue.rb84
1 files changed, 84 insertions, 0 deletions
diff --git a/t/test-custodian-queue.rb b/t/test-custodian-queue.rb
new file mode 100755
index 0000000..7e5d0d9
--- /dev/null
+++ b/t/test-custodian-queue.rb
@@ -0,0 +1,84 @@
+#!/usr/bin/ruby -I./lib/ -I../lib/
+
+
+require 'test/unit'
+require 'custodian/queue'
+
+
+
+
+#
+# Unit test for our queue-factory.
+#
+class TestCustodianQueue < Test::Unit::TestCase
+
+
+
+
+ #
+ # Create the test suite environment: NOP.
+ #
+ def setup
+ end
+
+
+
+
+ #
+ # Destroy the test suite environment: NOP.
+ #
+ def teardown
+ end
+
+
+
+
+ #
+ # Test that creating an unknown type throws an exception.
+ #
+ def test_unknown
+
+ # creation will fail
+ assert_raise RuntimeError do
+ t = Custodian::QueueType.create( "foo" )
+ end
+
+ end
+
+
+
+ def test_redis
+ q = nil
+ assert_nothing_raised do
+ q = Custodian::QueueType.create( "redis" )
+ end
+
+ #
+ # here we're testing we've got a derived class that has
+ # implemented "def size?"
+ #
+ assert_nothing_raised do
+ q.size?
+ end
+
+ end
+
+
+ def test_beanstalkd
+ q = nil
+ assert_nothing_raised do
+ q = Custodian::QueueType.create( "redis" )
+ end
+
+ #
+ # here we're testing we've got a derived class that has
+ # implemented "def size?"
+ #
+ assert_nothing_raised do
+ q.size?
+ end
+
+
+ end
+
+end