airbrake-ruby 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/airbrake-ruby/filters/keys_filter.rb +1 -1
- data/lib/airbrake-ruby/version.rb +1 -1
- data/spec/filters/keys_blacklist_spec.rb +22 -0
- data/spec/filters/thread_filter_spec.rb +34 -26
- data/spec/promise_spec.rb +0 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03b38987d8ca77dcd6c8302246192bd1a9184854
|
4
|
+
data.tar.gz: 93f4e52998430af6c6bcce0bca5e1b6dae3202ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f2ae08f59cb532ca0313d7d16eebab0ea9e54c5796048c57fc6418d2c7b18d37744450651f4743d4147b7288aba6f25ae0d8db88d0135104a50d35444d59be1
|
7
|
+
data.tar.gz: 0a327f231fea3629de145c84570c17f48a5f0e9c37050ed0a3f53ab8cea9d59d83c17c03066c4e025051d6f0870b9b0e5591345e1d76f554a42744b0a55949b0
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Airbrake::Filters::KeysBlacklist do
|
4
|
+
subject do
|
5
|
+
described_class.new(Logger.new('/dev/null'), patterns)
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "#call" do
|
9
|
+
let(:notice) do
|
10
|
+
Airbrake::Notice.new(Airbrake::Config.new, AirbrakeTestError.new)
|
11
|
+
end
|
12
|
+
|
13
|
+
context "when a pattern is a regexp and when a key is a hash" do
|
14
|
+
let(:patterns) { [/bango/] }
|
15
|
+
|
16
|
+
it "doesn't fail" do
|
17
|
+
notice[:params] = { bingo: { {} => 'unfiltered' } }
|
18
|
+
expect { subject.call(notice) }.not_to raise_error
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,23 +1,30 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
RSpec.describe Airbrake::Filters::ThreadFilter do
|
4
|
-
|
4
|
+
let(:notice) do
|
5
|
+
Airbrake::Notice.new(Airbrake::Config.new, AirbrakeTestError.new)
|
6
|
+
end
|
7
|
+
|
8
|
+
def new_thread
|
9
|
+
Thread.new do
|
10
|
+
th = Thread.current
|
5
11
|
|
6
|
-
|
7
|
-
|
12
|
+
# Ensure a thread always has some variable to make sure the
|
13
|
+
# :fiber_variables Hash is always present.
|
14
|
+
th[:random_var] = 42
|
15
|
+
yield(th)
|
16
|
+
end.join
|
17
|
+
end
|
8
18
|
|
9
19
|
shared_examples "fiber variable ignore" do |key|
|
10
20
|
it "ignores the :#{key} fiber variable" do
|
11
|
-
|
12
|
-
|
13
|
-
|
21
|
+
new_thread do |th|
|
22
|
+
th[key] = :bingo
|
23
|
+
subject.call(notice)
|
24
|
+
end
|
14
25
|
|
15
26
|
fiber_variables = notice[:params][:thread][:fiber_variables]
|
16
|
-
|
17
|
-
expect(fiber_variables).to be_nil
|
18
|
-
else
|
19
|
-
expect(fiber_variables[key]).to be_nil
|
20
|
-
end
|
27
|
+
expect(fiber_variables[key]).to be_nil
|
21
28
|
end
|
22
29
|
end
|
23
30
|
|
@@ -26,27 +33,28 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
26
33
|
end
|
27
34
|
|
28
35
|
it "appends thread variables" do
|
29
|
-
|
36
|
+
new_thread do |th|
|
30
37
|
th.thread_variable_set(:bingo, :bango)
|
31
38
|
subject.call(notice)
|
32
|
-
|
33
|
-
end.join
|
39
|
+
end
|
34
40
|
|
35
41
|
expect(notice[:params][:thread][:thread_variables][:bingo]).to eq(:bango)
|
36
42
|
end
|
37
43
|
|
38
44
|
it "appends fiber variables" do
|
39
|
-
|
40
|
-
|
41
|
-
|
45
|
+
new_thread do |th|
|
46
|
+
th[:bingo] = :bango
|
47
|
+
subject.call(notice)
|
48
|
+
end
|
42
49
|
|
43
50
|
expect(notice[:params][:thread][:fiber_variables][:bingo]).to eq(:bango)
|
44
51
|
end
|
45
52
|
|
46
53
|
it "appends name", skip: !Thread.current.respond_to?(:name) do
|
47
|
-
|
48
|
-
|
49
|
-
|
54
|
+
new_thread do |th|
|
55
|
+
th.name = 'bingo'
|
56
|
+
subject.call(notice)
|
57
|
+
end
|
50
58
|
|
51
59
|
expect(notice[:params][:thread][:name]).to eq('bingo')
|
52
60
|
end
|
@@ -83,19 +91,19 @@ RSpec.describe Airbrake::Filters::ThreadFilter do
|
|
83
91
|
end
|
84
92
|
|
85
93
|
it "doesn't append the IO object to thread variables" do
|
86
|
-
|
94
|
+
new_thread do |th|
|
87
95
|
th.thread_variable_set(:io, io_obj)
|
88
96
|
subject.call(notice)
|
89
|
-
|
90
|
-
end.join
|
97
|
+
end
|
91
98
|
|
92
99
|
expect(notice[:params][:thread][:thread_variables]).to be_nil
|
93
100
|
end
|
94
101
|
|
95
102
|
it "doesn't append the IO object to thread variables" do
|
96
|
-
|
97
|
-
|
98
|
-
|
103
|
+
new_thread do |th|
|
104
|
+
th[:io] = io_obj
|
105
|
+
subject.call(notice)
|
106
|
+
end
|
99
107
|
|
100
108
|
expect(notice[:params][:thread][:fiber_variables][:io]).to be_nil
|
101
109
|
end
|
data/spec/promise_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airbrake-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.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: 2017-05-
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- spec/config/validator_spec.rb
|
138
138
|
- spec/config_spec.rb
|
139
139
|
- spec/filter_chain_spec.rb
|
140
|
+
- spec/filters/keys_blacklist_spec.rb
|
140
141
|
- spec/filters/thread_filter_spec.rb
|
141
142
|
- spec/nested_exception_spec.rb
|
142
143
|
- spec/notice_spec.rb
|
@@ -179,6 +180,7 @@ test_files:
|
|
179
180
|
- spec/config/validator_spec.rb
|
180
181
|
- spec/config_spec.rb
|
181
182
|
- spec/filter_chain_spec.rb
|
183
|
+
- spec/filters/keys_blacklist_spec.rb
|
182
184
|
- spec/filters/thread_filter_spec.rb
|
183
185
|
- spec/nested_exception_spec.rb
|
184
186
|
- spec/notice_spec.rb
|