spec/lib/appsignal/rack/generic_instrumentation_spec.rb in appsignal-2.1.0.alpha.3 vs spec/lib/appsignal/rack/generic_instrumentation_spec.rb in appsignal-2.1.0.beta.1
- old
+ new
@@ -2,11 +2,11 @@
before :all do
start_agent
end
let(:app) { double(:call => true) }
- let(:env) { {:path => '/', :method => 'GET'} }
+ let(:env) { { :path => "/", :method => "GET" } }
let(:options) { {} }
let(:middleware) { Appsignal::Rack::GenericInstrumentation.new(app, options) }
describe "#call" do
before do
@@ -15,23 +15,23 @@
context "when appsignal is active" do
before { Appsignal.stub(:active? => true) }
it "should call with monitoring" do
- expect( middleware ).to receive(:call_with_appsignal_monitoring).with(env)
+ expect(middleware).to receive(:call_with_appsignal_monitoring).with(env)
end
end
context "when appsignal is not active" do
before { Appsignal.stub(:active? => false) }
it "should not call with monitoring" do
- expect( middleware ).to_not receive(:call_with_appsignal_monitoring)
+ expect(middleware).to_not receive(:call_with_appsignal_monitoring)
end
it "should call the stack" do
- expect( app ).to receive(:call).with(env)
+ expect(app).to receive(:call).with(env)
end
end
after { middleware.call(env) }
end
@@ -61,19 +61,19 @@
Appsignal::Transaction.any_instance.should_receive(:set_error).with(error)
end
end
it "should set the action to unknown" do
- Appsignal::Transaction.any_instance.should_receive(:set_action).with('unknown')
+ Appsignal::Transaction.any_instance.should_receive(:set_action).with("unknown")
end
context "with a route specified in the env" do
before do
- env['appsignal.route'] = 'GET /'
+ env["appsignal.route"] = "GET /"
end
it "should set the action" do
- Appsignal::Transaction.any_instance.should_receive(:set_action).with('GET /')
+ Appsignal::Transaction.any_instance.should_receive(:set_action).with("GET /")
end
end
it "should set metadata" do
Appsignal::Transaction.any_instance.should_receive(:set_metadata).twice