spec/integration/channel_close_spec.rb in amqp-0.8.0.rc12 vs spec/integration/channel_close_spec.rb in amqp-0.8.0.rc13

- old
+ new

@@ -4,12 +4,19 @@ describe AMQP::Channel, "#close(&callback)" do include EventedSpec::AMQPSpec it "takes a callback which will run when we get back Channel.Close-Ok" do - channel = AMQP::Channel.new do |*args| - channel.close do |channel, method| - done + @events = [] + + AMQP::Channel.new do |ch| + @events << :open_ok + ch.close do |channel, close_ok| + @events << :close_ok end end + + done(0.3) { + @events.should == [:open_ok, :close_ok] + } end end