

Should have_enqueued ( :tube => ' default ', :body => / foo / ) assert_enqueues/have_enqueued Should have been enqueued on the default tube you could use the following: # TestUnit/MiniTestĪssert_enqueued ( :tube => ' default ', :body => ' foo ' ) # You could also use a Regexp if you prefer To assert or set the expectation that a job with the body of 'foo' Releases, reserves, state, time-left, timeouts, The attributes available on a job for comparison are: age, body,īuries, connection, delay, id, kicks, pri, All attribute comparisons are performed using the triple-equal Identifies an attribute of a job that the corresponding Hash value should beĬompared against. Each key in the options Hash is a String or a Symbol that Same, the only difference is the invocation.Įach assertion/matcher takes a Hash of options that will be used to find Whether you are using the TestUnit/MiniTest or RSpec matchers, the usage is the Offers solid performance given the design of beanstalkd. Queue, but overall it is a powerful strategy that supports multiple servers and Suffers from some inefficiencies that come with trying to sequential access a The job traversal method employed by StalkClimber The strategy currently available, BeanCounter::Strategy::StalkClimber, utilizes Present, there is only a single strategy available, but at least one other is beanstalkd_url #=> īeanCounter.strategy allows you to choose and configure the strategyīeanCounter uses for accessing and interacting with the beanstalkd pool. beanstalkd_url #=> 'beanstalk://localhost'īeanCounter. beanstalkd_url = ' beanstalk://localhost ' BeanCounter. Require ' bean_counter/test_assertions ' # test/beaneater_test.rbĬlass BeaneaterTest īeanCounter. # in any test classes where you want to make use of the assertions: # bean_counter/test_assertions directly then include BeanCounter::TestAssertions Require ' bean_counter/mini_test ' # To maintain greater control over where the assertions are available, require Require ' bean_counter/test_unit ' # For MiniTest, adds assertions to MiniTest::Unit::TestCase and any derived classes: # For TestUnit, adds assertions to Test::Unit::TestCase and any derived classes: It in your test_helper: # To make the assertions available to all test cases you can require one of the In order to use BeanCounter in your tests you'll need to require and configure Test Framework Configuration TestUnit/MiniTest
#Ttr beancounter install
Or install it without bundler: $ gem install bean_counter InstallationĪdd this line to your application's Gemfile: gem ' bean_counter ' The entire beanstalkd pool by deleting the appropriate jobs.

With attributes matching the keys/values of the Hash given assert_enqueues/refute_enqueues - Searches only those jobs in theīeanstalkd pool enqueued during the execution of the provided block for jobs.Pool for jobs with attributes matching the keys/values of the Hash given assert_enqueued/refute_enqueued - Searches all jobs in the beanstalkd.Assertions/Matchers TestUnit/MiniTest Assertionsįor TestUnit/MiniTest, BeanCounter provides 6 assertions/refutations
#Ttr beancounter code
BeanCounter provides additional TestUnit/MiniTest assertions and/or RSpec matchers for testing Ruby code that relies onīeaneater and Beanstalkd.
