spec/transaction_spec.rb in stomper-0.4 vs spec/transaction_spec.rb in stomper-1.0.0
- old
+ new
@@ -33,11 +33,11 @@
describe "explicitly named" do
before(:each) do
@transaction_name = "tx-test"
@mock_client.should_receive(:begin).once.with(@transaction_name).and_return(nil)
- @mock_client.should_receive(:send).once.with("/queue/test/1","test message", hash_including("transaction" => @transaction_name)).and_return(nil)
+ @mock_client.should_receive(:send).once.with("/queue/test/1","test message", hash_including(:transaction => @transaction_name)).and_return(nil)
@mock_client.should_receive(:commit).once.with(@transaction_name).and_return(nil)
end
it "should use the given transaction ID as the transaction header in stomp messages" do
Transaction.new(@mock_client, @transaction_name) do |t|
@@ -48,11 +48,11 @@
describe "aborting failed transactions" do
before(:each) do
@transaction_name = "tx-test-2"
@mock_client.should_receive(:begin).once.with(@transaction_name).and_return(nil)
- @mock_client.should_receive(:send).once.with("/queue/test/1","test message", hash_including("transaction" => @transaction_name)).and_return(nil)
+ @mock_client.should_receive(:send).once.with("/queue/test/1","test message", hash_including(:transaction => @transaction_name)).and_return(nil)
end
it "should abort when an exception is raised" do
@mock_client.should_receive(:abort).once.with(@transaction_name).and_return(nil)
@mock_client.should_not_receive(:commit)
@@ -95,12 +95,12 @@
@transaction_name = "tx-test-3"
@inner_transaction_name = "#{@transaction_name}-inner"
@inner_inner_transaction_name = "#{@transaction_name}-inner-inner"
@mock_client.should_receive(:begin).with(@transaction_name).once.and_return(nil)
@mock_client.should_receive(:begin).with(@inner_transaction_name).once.and_return(nil)
- @mock_client.should_receive(:send).with("/queue/test/1","test message", hash_including("transaction" => @transaction_name)).once.and_return(nil)
- @mock_client.should_receive(:send).with("/queue/test/2","inner message", hash_including("transaction" => @inner_transaction_name)).once.and_return(nil)
+ @mock_client.should_receive(:send).with("/queue/test/1","test message", hash_including(:transaction => @transaction_name)).once.and_return(nil)
+ @mock_client.should_receive(:send).with("/queue/test/2","inner message", hash_including(:transaction => @inner_transaction_name)).once.and_return(nil)
end
it "no transaction should succeed when an inner one fails" do
@mock_client.should_receive(:abort).once.with(@transaction_name).and_return(nil)
@mock_client.should_receive(:abort).once.with(@inner_transaction_name).and_return(nil)
@mock_client.should_not_receive(:commit)
@@ -114,10 +114,10 @@
end
end.should raise_error(TransactionAborted)
end
it "no transaction should succeed when an inner one is explicitly aborted" do
@mock_client.should_receive(:begin).with(@inner_inner_transaction_name).once.and_return(nil)
- @mock_client.should_receive(:send).with("/queue/test/3","inner-inner message", hash_including("transaction" => @inner_inner_transaction_name)).once.and_return(nil)
+ @mock_client.should_receive(:send).with("/queue/test/3","inner-inner message", hash_including(:transaction => @inner_inner_transaction_name)).once.and_return(nil)
@mock_client.should_receive(:abort).once.with(@transaction_name).and_return(nil)
@mock_client.should_receive(:abort).once.with(@inner_transaction_name).and_return(nil)
@mock_client.should_receive(:abort).once.with(@inner_inner_transaction_name).and_return(nil)
@mock_client.should_not_receive(:commit)
lambda do