spec/lib/appsignal/transaction_spec.rb in appsignal-0.8.5 vs spec/lib/appsignal/transaction_spec.rb in appsignal-0.8.6.beta.0
- old
+ new
@@ -280,11 +280,14 @@
it { should be_instance_of Hash }
end
describe '#complete!' do
let(:event) { double(:event) }
- before { transaction.set_process_action_event(notification_event) }
+ before do
+ Appsignal::Pipe.stub(:current => nil)
+ transaction.set_process_action_event(notification_event)
+ end
it 'should remove transaction from the list' do
expect { transaction.complete! }.
to change(Appsignal.transactions, :length).by(-1)
end
@@ -323,9 +326,20 @@
before { transaction.complete! }
it 'should reset the thread transaction id' do
Thread.current[:appsignal_transaction_id].should be_nil
end
+ end
+
+ context 'when using pipes' do
+ let(:pipe) { double }
+ before { Appsignal::Pipe.stub(:current => pipe) }
+
+ it "should send itself trough the pipe" do
+ pipe.should_receive(:write).with(transaction)
+ end
+
+ after { transaction.complete! }
end
end
describe "#set_background_queue_start" do
before do