spec/rspec_amqp_spec.rb in amqp-spec-0.1.13 vs spec/rspec_amqp_spec.rb in amqp-spec-0.2.0
- old
+ new
@@ -1,13 +1,7 @@
require_relative 'spec_helper.rb'
-describe 'Rspec' do
- it 'should work as normal without AMQP-Spec' do
- 1.should == 1
- end
-end
-
def publish_and_consume_once(queue_name="test_sink", data="data")
amqp do
q = MQ.queue(queue_name)
q.subscribe do |hdr, msg|
hdr.should be_an MQ::Header
@@ -18,11 +12,17 @@
MQ.queue(queue_name).publish data
end
end
end
-context 'Evented AMQP specs' do
+describe RSPEC do
+ it 'should work as normal without AMQP-Spec' do
+ 1.should == 1
+ end
+end
+
+describe 'Evented AMQP specs' do
describe AMQP, " when testing with AMQP::SpecHelper" do
include AMQP::SpecHelper
default_options AMQP_OPTS if defined? AMQP_OPTS
default_timeout 1 # Can be used to set default :spec_timeout for all your amqp-based specs
@@ -53,21 +53,21 @@
it "bubbles failing expectations up to Rspec" do
expect {
amqp do
:this.should == :fail
end
- }.to raise_error Spec::Expectations::ExpectationNotMetError
+ }.to raise_error RSPEC::Expectations::ExpectationNotMetError
AMQP.conn.should == nil
end
it "should NOT ignore failing expectations after 'done'" do
expect {
amqp do
done
:this.should == :fail
end
- }.to raise_error Spec::Expectations::ExpectationNotMetError
+ }.to raise_error RSPEC::Expectations::ExpectationNotMetError
AMQP.conn.should == nil
end
it "should properly close AMQP connection after Rspec failures" do
AMQP.conn.should == nil
@@ -89,10 +89,10 @@
Thread.current[:mq].should be_nil
end
end
end
-describe "Rspec", " when running an example group after another group that uses AMQP-Spec " do
+describe RSPEC, " when running an example group after another group that uses AMQP-Spec " do
it "should work normally" do
:does_not_hang.should_not be_false
end
end
\ No newline at end of file