<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -37,4 +37,27 @@ class QueuePollingTest &lt; Test::Unit::TestCase
     assert_equal 10, collected.length
   end
   
+  def test_should_collect_messages_on_a_specific_tube_as_they_are_received
+    collected = []
+    
+    consumer = Thread.new do
+      poller = Beanstalk::QueuePoller.new(@queue_manager, timeout = 30, output = stub_everything('output stream'))
+      poller.poll(:testqueue, 'exampletube') do |message|
+        collected &lt;&lt; message
+      end
+    end
+    
+    queue = Beanstalk::Queue.connect('0.0.0.0', 33000)
+    queue.use_tube('exampletube')
+    sleep 0.5 # give the poller and queue connection time to start up
+    10.times do
+      queue &lt;&lt; 'message'
+    end
+    
+    sleep 1
+    consumer.kill
+    
+    assert_equal 10, collected.length
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>test/acceptance/queue_polling_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1bc91e3e9e8cea1fb8e1446f2696ebc621a6b191</id>
    </parent>
  </parents>
  <author>
    <name>lukeredpath</name>
    <email>lukeredpath@53438b35-87ee-0310-8825-c8c94c0097b6</email>
  </author>
  <url>http://github.com/lukeredpath/beanstalk-messaging/commit/c01affb01e4c5ecaae23545fe27cbf5183943b49</url>
  <id>c01affb01e4c5ecaae23545fe27cbf5183943b49</id>
  <committed-date>2008-11-14T08:23:08-08:00</committed-date>
  <authored-date>2008-11-14T08:23:08-08:00</authored-date>
  <message>Consumer threads in polling acceptance tests *must* be killed or they will hang around with other tests and cause random failures eventually leading to insanity.


git-svn-id: http://svn/repos/plugins/beanstalk_messaging@14510 53438b35-87ee-0310-8825-c8c94c0097b6</message>
  <tree>c17abb5af686e048105ea7467a8699d4fcbf2a47</tree>
  <committer>
    <name>lukeredpath</name>
    <email>lukeredpath@53438b35-87ee-0310-8825-c8c94c0097b6</email>
  </committer>
</commit>
