airbrake 8.1.2 → 8.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/airbrake/logger.rb +7 -1
- data/lib/airbrake/rack.rb +1 -0
- data/lib/airbrake/rack/middleware.rb +19 -15
- data/lib/airbrake/rack/request_store.rb +32 -0
- data/lib/airbrake/rails/action_controller_notify_subscriber.rb +4 -4
- data/lib/airbrake/rails/action_controller_route_subscriber.rb +3 -3
- data/lib/airbrake/rails/active_record_subscriber.rb +5 -3
- data/lib/airbrake/version.rb +1 -1
- data/spec/apps/rails/logs/32.log +1546 -0
- data/spec/unit/logger_spec.rb +21 -2
- data/spec/unit/rack/request_store_spec.rb +38 -0
- metadata +5 -2
data/spec/unit/logger_spec.rb
CHANGED
@@ -6,7 +6,9 @@ RSpec.describe Airbrake::AirbrakeLogger do
|
|
6
6
|
let(:endpoint) { "https://api.airbrake.io/api/v3/projects/#{project_id}/notices" }
|
7
7
|
|
8
8
|
let(:airbrake) do
|
9
|
-
Airbrake::
|
9
|
+
Airbrake::NoticeNotifier.new(
|
10
|
+
Airbrake::Config.new(project_id: project_id, project_key: project_key)
|
11
|
+
)
|
10
12
|
end
|
11
13
|
|
12
14
|
let(:logger) { Logger.new('/dev/null') }
|
@@ -23,7 +25,7 @@ RSpec.describe Airbrake::AirbrakeLogger do
|
|
23
25
|
|
24
26
|
describe "#airbrake_notifier" do
|
25
27
|
it "has the default notifier installed by default" do
|
26
|
-
expect(subject.airbrake_notifier).to be_an(Airbrake::
|
28
|
+
expect(subject.airbrake_notifier).to be_an(Airbrake::NoticeNotifier)
|
27
29
|
end
|
28
30
|
|
29
31
|
it "installs Airbrake notifier" do
|
@@ -115,4 +117,21 @@ RSpec.describe Airbrake::AirbrakeLogger do
|
|
115
117
|
end
|
116
118
|
end
|
117
119
|
end
|
120
|
+
|
121
|
+
describe "#level=" do
|
122
|
+
it "sets logger level" do
|
123
|
+
subject.level = Logger::FATAL
|
124
|
+
expect(subject.level).to eq(Logger::FATAL)
|
125
|
+
end
|
126
|
+
|
127
|
+
it "sets airbrake level" do
|
128
|
+
subject.level = Logger::FATAL
|
129
|
+
expect(subject.airbrake_level).to eq(Logger::FATAL)
|
130
|
+
end
|
131
|
+
|
132
|
+
it "normalizes airbrake logger level when provided level is below WARN" do
|
133
|
+
subject.level = Logger::DEBUG
|
134
|
+
expect(subject.airbrake_level).to eq(Logger::WARN)
|
135
|
+
end
|
136
|
+
end
|
118
137
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Airbrake::Rack::RequestStore do
|
4
|
+
after { described_class.clear }
|
5
|
+
|
6
|
+
describe "#store" do
|
7
|
+
it "returns an empty Hash" do
|
8
|
+
expect(subject.store).to be_a(Hash)
|
9
|
+
expect(subject.store).to be_empty
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "#[]=" do
|
14
|
+
it "writes a value under a key" do
|
15
|
+
subject[:foo] = :bar
|
16
|
+
expect(subject.store).to eq(foo: :bar)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "#[]" do
|
21
|
+
it "reads a value under a key" do
|
22
|
+
subject[:foo] = :bar
|
23
|
+
expect(subject[:foo]).to eq(:bar)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "#clear" do
|
28
|
+
before do
|
29
|
+
subject[:foo] = 1
|
30
|
+
subject[:bar] = 2
|
31
|
+
end
|
32
|
+
|
33
|
+
it "clears everything in the store" do
|
34
|
+
subject.clear
|
35
|
+
expect(subject.store).to be_empty
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.1.
|
4
|
+
version: 8.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airbrake Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: airbrake-ruby
|
@@ -254,6 +254,7 @@ files:
|
|
254
254
|
- lib/airbrake/rack/http_params_filter.rb
|
255
255
|
- lib/airbrake/rack/middleware.rb
|
256
256
|
- lib/airbrake/rack/request_body_filter.rb
|
257
|
+
- lib/airbrake/rack/request_store.rb
|
257
258
|
- lib/airbrake/rack/route_filter.rb
|
258
259
|
- lib/airbrake/rack/session_filter.rb
|
259
260
|
- lib/airbrake/rack/user.rb
|
@@ -297,6 +298,7 @@ files:
|
|
297
298
|
- spec/unit/rack/http_params_filter_spec.rb
|
298
299
|
- spec/unit/rack/middleware_spec.rb
|
299
300
|
- spec/unit/rack/request_body_filter_spec.rb
|
301
|
+
- spec/unit/rack/request_store_spec.rb
|
300
302
|
- spec/unit/rack/route_filter_spec.rb
|
301
303
|
- spec/unit/rack/session_filter_spec.rb
|
302
304
|
- spec/unit/rack/user_filter_spec.rb
|
@@ -339,6 +341,7 @@ test_files:
|
|
339
341
|
- spec/unit/sidekiq_spec.rb
|
340
342
|
- spec/unit/shoryuken_spec.rb
|
341
343
|
- spec/unit/sneakers_spec.rb
|
344
|
+
- spec/unit/rack/request_store_spec.rb
|
342
345
|
- spec/unit/rack/request_body_filter_spec.rb
|
343
346
|
- spec/unit/rack/http_params_filter_spec.rb
|
344
347
|
- spec/unit/rack/http_headers_filter_spec.rb
|