Skip to content

Commit

Permalink
Merge pull request #211 from litch/master
Browse files Browse the repository at this point in the history
Fixes the class-level Exchange default initialization
  • Loading branch information
michaelklishin committed May 11, 2014
2 parents 9d25ac1 + a6cad0b commit a820fd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bunny/exchange.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Exchange
# @return [Exchange] An instance that corresponds to the default exchange (of type direct).
# @api public
def self.default(channel_or_connection)
self.new(channel_from(channel_or_connection), :direct, AMQ::Protocol::EMPTY_STRING, :no_declare => true)
self.new(channel_or_connection, :direct, AMQ::Protocol::EMPTY_STRING, :no_declare => true)
end

# @param [Bunny::Channel] channel_or_connection Channel this exchange will use. {Bunny::Session} instances are supported only for
Expand Down
9 changes: 9 additions & 0 deletions spec/higher_level_api/integration/exchange_declare_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
connection.close
end

context "of default type" do
it "is declared with an empty name" do
ch = connection.create_channel

x = Bunny::Exchange.default(ch)

x.name.should == ''
end
end

context "of type fanout" do
context "with a non-predefined name" do
Expand Down

0 comments on commit a820fd4

Please sign in to comment.