diff options
| author | James Turnbull <james@lovedthanlost.net> | 2011-04-20 02:35:40 +1000 |
|---|---|---|
| committer | Josh Cooper <josh@puppetlabs.com> | 2011-04-20 09:39:44 -0700 |
| commit | 9a5bf6e25d5871bda3252028c02846bfb2d8708b (patch) | |
| tree | 6aee2ff06de50d332140556e4b46ec6dafd8d9bc /spec | |
| parent | 72cd6fb383335a62d2d1ab656cdff39c34de0f19 (diff) | |
| download | puppet-9a5bf6e25d5871bda3252028c02846bfb2d8708b.tar.gz puppet-9a5bf6e25d5871bda3252028c02846bfb2d8708b.tar.xz puppet-9a5bf6e25d5871bda3252028c02846bfb2d8708b.zip | |
Fixed #7166 - Replaced deprecated stomp "send" method with "publish"
The "send" method in the stomp gem has been deprecated since:
http://gitorious.org/stomp/mainline/commit/d542a976028cb4c5badcbb69e3383e746721e44c
It's been replaced with the "publish" method.
Also renamed the send_message method to publish_message more in
keeping with language used in queuing.
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/integration/indirector/catalog/queue_spec.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/indirector/queue_spec.rb | 8 | ||||
| -rwxr-xr-x | spec/unit/util/queue/stomp_spec.rb | 20 |
3 files changed, 16 insertions, 16 deletions
diff --git a/spec/integration/indirector/catalog/queue_spec.rb b/spec/integration/indirector/catalog/queue_spec.rb index 4581e3062..5a4a8a4ab 100755 --- a/spec/integration/indirector/catalog/queue_spec.rb +++ b/spec/integration/indirector/catalog/queue_spec.rb @@ -20,13 +20,13 @@ describe "Puppet::Resource::Catalog::Queue", :if => Puppet.features.pson? do after { Puppet.settings.clear } - it "should render catalogs to pson and send them via the queue client when catalogs are saved" do + it "should render catalogs to pson and publish them via the queue client when catalogs are saved" do terminus = Puppet::Resource::Catalog.indirection.terminus(:queue) client = mock 'client' terminus.stubs(:client).returns client - client.expects(:send_message).with(:catalog, @catalog.to_pson) + client.expects(:publish_message).with(:catalog, @catalog.to_pson) request = Puppet::Indirector::Request.new(:catalog, :save, "foo", :instance => @catalog) diff --git a/spec/unit/indirector/queue_spec.rb b/spec/unit/indirector/queue_spec.rb index bbe00c75f..bfd7598ad 100755 --- a/spec/unit/indirector/queue_spec.rb +++ b/spec/unit/indirector/queue_spec.rb @@ -63,20 +63,20 @@ describe Puppet::Indirector::Queue, :if => Puppet.features.pson? do describe "when saving" do it 'should render the instance using pson' do @subject.expects(:render).with(:pson) - @store.client.stubs(:send_message) + @store.client.stubs(:publish_message) @store.save(@request) end - it "should send the rendered message to the appropriate queue on the client" do + it "should publish the rendered message to the appropriate queue on the client" do @subject.expects(:render).returns "mypson" - @store.client.expects(:send_message).with(:my_queue, "mypson") + @store.client.expects(:publish_message).with(:my_queue, "mypson") @store.save(@request) end it "should catch any exceptions raised" do - @store.client.expects(:send_message).raises ArgumentError + @store.client.expects(:publish_message).raises ArgumentError lambda { @store.save(@request) }.should raise_error(Puppet::Error) end diff --git a/spec/unit/util/queue/stomp_spec.rb b/spec/unit/util/queue/stomp_spec.rb index c33f1a670..91036793c 100755 --- a/spec/unit/util/queue/stomp_spec.rb +++ b/spec/unit/util/queue/stomp_spec.rb @@ -64,26 +64,26 @@ describe 'Puppet::Util::Queue::Stomp', :if => Puppet.features.stomp? do end end - describe "when sending a message" do + describe "when publishing a message" do before do @client = stub 'client' Stomp::Client.stubs(:new).returns @client @queue = Puppet::Util::Queue::Stomp.new end - it "should send it to the queue client instance" do - @client.expects(:send).with { |queue, msg, options| msg == "Smite!" } - @queue.send_message('fooqueue', 'Smite!') + it "should publish it to the queue client instance" do + @client.expects(:publish).with { |queue, msg, options| msg == "Smite!" } + @queue.publish_message('fooqueue', 'Smite!') end - it "should send it to the transformed queue name" do - @client.expects(:send).with { |queue, msg, options| queue == "/queue/fooqueue" } - @queue.send_message('fooqueue', 'Smite!') + it "should publish it to the transformed queue name" do + @client.expects(:publish).with { |queue, msg, options| queue == "/queue/fooqueue" } + @queue.publish_message('fooqueue', 'Smite!') end - it "should send it as a persistent message" do - @client.expects(:send).with { |queue, msg, options| options[:persistent] == true } - @queue.send_message('fooqueue', 'Smite!') + it "should publish it as a persistent message" do + @client.expects(:publish).with { |queue, msg, options| options[:persistent] == true } + @queue.publish_message('fooqueue', 'Smite!') end end |
