Permalink
Browse files

Gracefully support #prefetch for queues by at least ignoring it

  • Loading branch information...
1 parent 981d7a4 commit 88a5057b37833a6664b68aa5e72437b222934c41 Larry Diehl committed Jul 30, 2009
Showing with 11 additions and 3 deletions.
  1. +1 −1 VERSION.yml
  2. +4 −0 lib/moqueue/mock_queue.rb
  3. +1 −1 moqueue.gemspec
  4. +5 −1 spec/unit/mock_queue_spec.rb
View
@@ -1,4 +1,4 @@
---
:major: 0
:minor: 1
-:patch: 2
+:patch: 3
@@ -48,6 +48,10 @@ def received_message?(message_content)
def unsubscribe
true
end
+
+ def prefetch(size)
+ # noop
+ end
def received_ack_for_message?(message_content)
acked_messages.include?(message_content)
View
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{moqueue}
- s.version = "0.1.2"
+ s.version = "0.1.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Daniel DeLeo"]
@@ -87,6 +87,10 @@
pending ("should really remove the association with exchange")
@queue.should respond_to(:unsubscribe)
end
+
+ it "should ignore #prefetch but at least raise an error" do
+ lambda { @queue.prefetch(1337) }.should_not raise_error
+ end
it "should raise an error on double subscribe" do
@queue.subscribe { |msg| "once" }
@@ -138,4 +142,4 @@
queue.received_message?("I'm feelin this").should be_true
end
-end
+end

0 comments on commit 88a5057

Please sign in to comment.