require 'spec_helper' require 'beanstalk-client-rspec' describe Beanstalk::MockPool do before do @beanstalk = Beanstalk::MockPool.new ['127.0.0.1:11301'] end it 'should accept objects on the default' do @beanstalk.put 'cow' job = @beanstalk.reserve job.body.should == 'cow' job.release job = @beanstalk.reserve job.body.should == 'cow' job.delete end it 'should accept objects on a named tube' do @beanstalk.use 'moo' @beanstalk.put 'cow' @beanstalk.watch 'moo' @beanstalk.ignore 'default' job = @beanstalk.reserve job.body.should == 'cow' end it 'should deal with on_tube' do @beanstalk.on_tube 'foo' do |c| c.put 'cow' end @beanstalk.watch 'foo' @beanstalk.ignore 'default' job = @beanstalk.reserve job.body.should == 'cow' end end