spec/spec_helper.rb in qsagi-0.0.3 vs spec/spec_helper.rb in qsagi-0.1.0
- old
+ new
@@ -1,6 +1,7 @@
require "qsagi"
+require "ostruct"
class ExampleQueue
include Qsagi::Queue
def self.host
@@ -20,12 +21,10 @@
end
end
RSpec.configure do |c|
c.before(:each) do
- client = Bunny.new(:host => ExampleQueue.host, :port => ExampleQueue.port)
- client.start
- queue = client.queue(ExampleQueue.queue_name, :durable => true, :arguments => {"x-ha-policy" => "all"})
- queue.delete rescue nil
- client.send(:close_socket)
+ ExampleQueue.connect do |queue|
+ queue.clear
+ end
end
end