blob: c25fc24bf33acf286b75ea27ce5424ba5e950d65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#!/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
unless defined? ::Redis
if methods.include? :skip
skip("Redis library missing -- skipping tests")
else
omit("Redis library missing -- skipping tests")
end
end
end
#
# Destroy the test suite environment: NOP.
#
def teardown
end
#
# Test we can create and use a Redis queue.
#
def test_redis
q = nil
assert_nothing_raised do
q = Custodian::RedisQueueType.new()
end
#
# here we're testing we've got a derived class that has
# implemented the methods "size?" & "flush!"
#
assert_nothing_raised do
q.size?
q.flush!
end
end
end
|