diff options
Diffstat (limited to 't/test-custodian-queue.rb')
| -rwxr-xr-x | t/test-custodian-queue.rb | 84 | 
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 | 
