Sha256: 23e6106c87fca3e33a3e0ce4fd5a7107ef9e0331fdd0f446611472721b7ff84a
Contents?: true
Size: 1.29 KB
Versions: 44
Compression:
Stored size: 1.29 KB
Contents
RSpec.shared_examples "instrument helper" do around { |example| keep_transactions { example.run } } let(:stub) { double(:method_call => "return value") } it "records an event around the given block" do return_value = instrumenter.instrument "name", "title", "body" do stub.method_call end expect(return_value).to eq "return value" expect_transaction_to_have_event end context "with an error raised in the passed block" do it "records an event around the given block" do expect do instrumenter.instrument "name", "title", "body" do stub.method_call raise ExampleException, "foo" end end.to raise_error(ExampleException, "foo") expect_transaction_to_have_event end end context "with an error raise in the passed block" do it "records an event around the given block" do expect do instrumenter.instrument "name", "title", "body" do stub.method_call throw :foo end end.to throw_symbol(:foo) expect_transaction_to_have_event end end def expect_transaction_to_have_event expect(transaction).to include_event( "name" => "name", "title" => "title", "body" => "body", "body_format" => Appsignal::EventFormatter::DEFAULT ) end end
Version data entries
44 entries across 44 versions & 1 rubygems