lib/beanstalk-client-rspec/matchers.rb in beanstalk-client-rspec-0.0.5 vs lib/beanstalk-client-rspec/matchers.rb in beanstalk-client-rspec-0.0.6

- old
+ new

@@ -45,5 +45,24 @@ description do "have #{size} jobs in tube" end end +RSpec::Matchers.define :have_tube_size_of_gt do |size| + extend TubeHelper + match do |actual| + tube_size(actual) > size + end + + failure_message_for_should do |actual| + "expected that tube #{actual} would have greater than #{size} jobs, but got #{tube_size(actual)} jobs instead" + end + + failure_message_for_should_not do |actual| + "expected that tube #{actual} would not have greater than #{size} jobs, but got #{tube_size(actual)} jobs instead" + end + + description do + "have greater than #{size} jobs in tube" + end +end +