airbrake-ruby 6.0.2-java → 6.1.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/lib/airbrake-ruby/config/processor.rb +6 -0
  3. data/lib/airbrake-ruby/filters/git_last_checkout_filter.rb +1 -1
  4. data/lib/airbrake-ruby/filters/git_repository_filter.rb +7 -1
  5. data/lib/airbrake-ruby/nested_exception.rb +22 -1
  6. data/lib/airbrake-ruby/notice.rb +5 -3
  7. data/lib/airbrake-ruby/sync_sender.rb +2 -2
  8. data/lib/airbrake-ruby/version.rb +1 -1
  9. metadata +4 -122
  10. data/spec/airbrake_spec.rb +0 -522
  11. data/spec/async_sender_spec.rb +0 -65
  12. data/spec/backtrace_spec.rb +0 -430
  13. data/spec/benchmark_spec.rb +0 -35
  14. data/spec/code_hunk_spec.rb +0 -124
  15. data/spec/config/processor_spec.rb +0 -151
  16. data/spec/config/validator_spec.rb +0 -204
  17. data/spec/config_spec.rb +0 -188
  18. data/spec/context_spec.rb +0 -54
  19. data/spec/deploy_notifier_spec.rb +0 -50
  20. data/spec/file_cache_spec.rb +0 -35
  21. data/spec/filter_chain_spec.rb +0 -124
  22. data/spec/filters/context_filter_spec.rb +0 -32
  23. data/spec/filters/dependency_filter_spec.rb +0 -14
  24. data/spec/filters/exception_attributes_filter_spec.rb +0 -52
  25. data/spec/filters/gem_root_filter_spec.rb +0 -44
  26. data/spec/filters/git_last_checkout_filter_spec.rb +0 -61
  27. data/spec/filters/git_repository_filter.rb +0 -61
  28. data/spec/filters/git_revision_filter_spec.rb +0 -126
  29. data/spec/filters/keys_allowlist_spec.rb +0 -204
  30. data/spec/filters/keys_blocklist_spec.rb +0 -242
  31. data/spec/filters/root_directory_filter_spec.rb +0 -39
  32. data/spec/filters/sql_filter_spec.rb +0 -274
  33. data/spec/filters/system_exit_filter_spec.rb +0 -16
  34. data/spec/filters/thread_filter_spec.rb +0 -281
  35. data/spec/fixtures/notroot.txt +0 -7
  36. data/spec/fixtures/project_root/code.rb +0 -221
  37. data/spec/fixtures/project_root/empty_file.rb +0 -0
  38. data/spec/fixtures/project_root/long_line.txt +0 -1
  39. data/spec/fixtures/project_root/short_file.rb +0 -3
  40. data/spec/fixtures/project_root/vendor/bundle/ignored_file.rb +0 -5
  41. data/spec/helpers.rb +0 -9
  42. data/spec/ignorable_spec.rb +0 -14
  43. data/spec/inspectable_spec.rb +0 -45
  44. data/spec/loggable_spec.rb +0 -17
  45. data/spec/monotonic_time_spec.rb +0 -25
  46. data/spec/nested_exception_spec.rb +0 -73
  47. data/spec/notice_notifier/options_spec.rb +0 -269
  48. data/spec/notice_notifier_spec.rb +0 -361
  49. data/spec/notice_spec.rb +0 -300
  50. data/spec/performance_breakdown_spec.rb +0 -11
  51. data/spec/performance_notifier_spec.rb +0 -645
  52. data/spec/promise_spec.rb +0 -203
  53. data/spec/query_spec.rb +0 -11
  54. data/spec/queue_spec.rb +0 -18
  55. data/spec/remote_settings/callback_spec.rb +0 -162
  56. data/spec/remote_settings/settings_data_spec.rb +0 -348
  57. data/spec/remote_settings_spec.rb +0 -201
  58. data/spec/request_spec.rb +0 -9
  59. data/spec/response_spec.rb +0 -110
  60. data/spec/spec_helper.rb +0 -100
  61. data/spec/stashable_spec.rb +0 -23
  62. data/spec/stat_spec.rb +0 -39
  63. data/spec/sync_sender_spec.rb +0 -168
  64. data/spec/tdigest_spec.rb +0 -235
  65. data/spec/thread_pool_spec.rb +0 -196
  66. data/spec/time_truncate_spec.rb +0 -30
  67. data/spec/timed_trace_spec.rb +0 -127
  68. data/spec/truncator_spec.rb +0 -267
data/spec/promise_spec.rb DELETED
@@ -1,203 +0,0 @@
1
- RSpec.describe Airbrake::Promise do
2
- subject(:promise) { described_class.new }
3
-
4
- describe ".then" do
5
- let(:resolved_with) { [] }
6
- let(:rejected_with) { [] }
7
-
8
- context "when it is not resolved" do
9
- it "returns self" do
10
- expect(promise.then { anything }).to eq(promise)
11
- end
12
-
13
- it "doesn't call the resolve callbacks yet" do
14
- promise.then { resolved_with << 1 }.then { resolved_with << 2 }
15
- expect(resolved_with).to be_empty
16
- end
17
- end
18
-
19
- context "when it is resolved" do
20
- shared_examples "then specs" do
21
- it "returns self" do
22
- expect(promise.then { anything }).to eq(promise)
23
- end
24
-
25
- it "yields the resolved value" do
26
- yielded = nil
27
- promise.then { |value| yielded = value }
28
- expect(yielded).to eq('id' => '123')
29
- end
30
-
31
- it "calls the resolve callbacks" do
32
- expect(resolved_with).to match_array([1, 2])
33
- end
34
-
35
- it "doesn't call the reject callbacks" do
36
- expect(rejected_with).to be_empty
37
- end
38
- end
39
-
40
- context "and there are some resolve and reject callbacks in place" do
41
- before do
42
- promise.then { resolved_with << 1 }.then { resolved_with << 2 }
43
- promise.rescue { rejected_with << 1 }.rescue { rejected_with << 2 }
44
- promise.resolve('id' => '123')
45
- end
46
-
47
- include_examples "then specs"
48
-
49
- it "registers the resolve callbacks" do
50
- promise.resolve('id' => '456')
51
- expect(resolved_with).to match_array([1, 2, 1, 2])
52
- end
53
- end
54
-
55
- context "and additional then callbacks are added" do
56
- before do
57
- promise.resolve('id' => '123')
58
- promise.then { resolved_with << 1 }.then { resolved_with << 2 }
59
- end
60
-
61
- include_examples "then specs"
62
-
63
- it "doesn't register new resolve callbacks" do
64
- promise.resolve('id' => '456')
65
- expect(resolved_with).to match_array([1, 2])
66
- end
67
- end
68
- end
69
- end
70
-
71
- describe ".rescue" do
72
- let(:resolved_with) { [] }
73
- let(:rejected_with) { [] }
74
-
75
- context "when it is not rejected" do
76
- it "returns self" do
77
- expect(promise.then { anything }).to eq(promise)
78
- end
79
-
80
- it "doesn't call the reject callbacks yet" do
81
- promise.rescue { rejected_with << 1 }.rescue { rejected_with << 2 }
82
- expect(rejected_with).to be_empty
83
- end
84
- end
85
-
86
- context "when it is rejected" do
87
- shared_examples "rescue specs" do
88
- it "returns self" do
89
- expect(promise.rescue { anything }).to eq(promise)
90
- end
91
-
92
- it "yields the rejected value" do
93
- yielded = nil
94
- promise.rescue { |value| yielded = value }
95
- expect(yielded).to eq('bingo')
96
- end
97
-
98
- it "doesn't call the resolve callbacks" do
99
- expect(resolved_with).to be_empty
100
- end
101
-
102
- it "calls the reject callbacks" do
103
- expect(rejected_with).to match_array([1, 2])
104
- end
105
- end
106
-
107
- context "and there are some resolve and reject callbacks in place" do
108
- before do
109
- promise.then { resolved_with << 1 }.then { resolved_with << 2 }
110
- promise.rescue { rejected_with << 1 }.rescue { rejected_with << 2 }
111
- promise.reject('bingo')
112
- end
113
-
114
- include_examples "rescue specs"
115
-
116
- it "registers the reject callbacks" do
117
- promise.reject('bingo again')
118
- expect(rejected_with).to match_array([1, 2, 1, 2])
119
- end
120
- end
121
-
122
- context "and additional reject callbacks are added" do
123
- before do
124
- promise.reject('bingo')
125
- promise.rescue { rejected_with << 1 }.rescue { rejected_with << 2 }
126
- end
127
-
128
- include_examples "rescue specs"
129
-
130
- it "doesn't register new reject callbacks" do
131
- promise.reject('bingo again')
132
- expect(rejected_with).to match_array([1, 2])
133
- end
134
- end
135
- end
136
- end
137
-
138
- describe ".resolve" do
139
- it "returns self" do
140
- expect(promise.resolve(1)).to eq(promise)
141
- end
142
-
143
- it "executes callbacks attached with .then" do
144
- array = []
145
- promise.then { |notice_id| array << notice_id }.rescue { array << 999 }
146
-
147
- expect(array.size).to be_zero
148
- promise.resolve(1)
149
- expect(array).to match_array([1])
150
- end
151
- end
152
-
153
- describe ".reject" do
154
- it "returns self" do
155
- expect(promise.reject(1)).to eq(promise)
156
- end
157
-
158
- it "executes callbacks attached with .rescue" do
159
- array = []
160
- promise.then { array << 1 }.rescue { |error| array << error }
161
-
162
- expect(array.size).to be_zero
163
- promise.reject(999)
164
- expect(array).to match_array([999])
165
- end
166
- end
167
-
168
- describe "#rejected?" do
169
- context "when it was rejected" do
170
- before { promise.reject(1) }
171
-
172
- it { is_expected.to be_rejected }
173
- end
174
-
175
- context "when it wasn't rejected" do
176
- it { is_expected.not_to be_rejected }
177
- end
178
-
179
- context "when it was resolved" do
180
- before { promise.resolve }
181
-
182
- it { is_expected.not_to be_rejected }
183
- end
184
- end
185
-
186
- describe "#resolved?" do
187
- context "when it was resolved" do
188
- before { promise.resolve }
189
-
190
- it { is_expected.to be_resolved }
191
- end
192
-
193
- context "when it wasn't resolved" do
194
- it { is_expected.not_to be_resolved }
195
- end
196
-
197
- context "when it was rejected" do
198
- before { promise.reject(1) }
199
-
200
- it { is_expected.not_to be_resolved }
201
- end
202
- end
203
- end
data/spec/query_spec.rb DELETED
@@ -1,11 +0,0 @@
1
- RSpec.describe Airbrake::Query do
2
- describe "#stash" do
3
- subject do
4
- described_class.new(
5
- method: 'GET', route: '/', query: '',
6
- )
7
- end
8
-
9
- it { is_expected.to respond_to(:stash) }
10
- end
11
- end
data/spec/queue_spec.rb DELETED
@@ -1,18 +0,0 @@
1
- RSpec.describe Airbrake::Queue do
2
- subject { described_class.new(queue: 'bananas', error_count: 0) }
3
-
4
- describe "#ignore" do
5
- it { is_expected.to respond_to(:ignore!) }
6
- end
7
-
8
- describe "#stash" do
9
- it { is_expected.to respond_to(:stash) }
10
- end
11
-
12
- describe "#route" do
13
- it "always returns an empty route" do
14
- queue = described_class.new(queue: 'a', error_count: 0)
15
- expect(queue.route).to be_empty
16
- end
17
- end
18
- end
@@ -1,162 +0,0 @@
1
- RSpec.describe Airbrake::RemoteSettings::Callback do
2
- describe "#call" do
3
- let(:logger) { Logger.new(File::NULL) }
4
-
5
- let(:config) do
6
- Airbrake::Config.new(
7
- project_id: 123,
8
- logger: logger,
9
- )
10
- end
11
-
12
- let(:data) do
13
- instance_double(Airbrake::RemoteSettings::SettingsData)
14
- end
15
-
16
- before do
17
- allow(data).to receive(:to_h)
18
- allow(data).to receive(:error_host)
19
- allow(data).to receive(:apm_host)
20
- allow(data).to receive(:error_notifications?)
21
- allow(data).to receive(:performance_stats?)
22
- end
23
-
24
- it "logs given data" do
25
- allow(logger).to receive(:debug)
26
-
27
- described_class.new(config).call(data)
28
-
29
- expect(logger).to have_received(:debug) do |&block|
30
- expect(block.call).to match(/applying remote settings/)
31
- end
32
- end
33
-
34
- context "when the config disables error notifications" do
35
- before do
36
- config.error_notifications = false
37
- allow(data).to receive(:error_notifications?).and_return(true)
38
- end
39
-
40
- # rubocop:disable RSpec/MultipleExpectations
41
- it "keeps the option disabled forever" do
42
- callback = described_class.new(config)
43
-
44
- callback.call(data)
45
- expect(config.error_notifications).to eq(false)
46
-
47
- callback.call(data)
48
- expect(config.error_notifications).to eq(false)
49
-
50
- callback.call(data)
51
- expect(config.error_notifications).to eq(false)
52
- end
53
- # rubocop:enable RSpec/MultipleExpectations
54
- end
55
-
56
- context "when the config enables error notifications" do
57
- before { config.error_notifications = true }
58
-
59
- # rubocop:disable RSpec/MultipleExpectations
60
- it "can disable and enable error notifications" do
61
- callback = described_class.new(config)
62
-
63
- allow(data).to receive(:error_notifications?).and_return(false)
64
-
65
- callback.call(data)
66
- expect(config.error_notifications).to eq(false)
67
-
68
- allow(data).to receive(:error_notifications?).and_return(true)
69
-
70
- callback.call(data)
71
- expect(config.error_notifications).to eq(true)
72
-
73
- expect(data).to have_received(:error_notifications?).twice
74
- end
75
- # rubocop:enable RSpec/MultipleExpectations
76
- end
77
-
78
- context "when the config disables performance_stats" do
79
- before do
80
- config.performance_stats = false
81
- allow(data).to receive(:performance_stats?).and_return(true)
82
- end
83
-
84
- # rubocop:disable RSpec/MultipleExpectations
85
- it "keeps the option disabled forever" do
86
- callback = described_class.new(config)
87
-
88
- callback.call(data)
89
- expect(config.performance_stats).to eq(false)
90
-
91
- callback.call(data)
92
- expect(config.performance_stats).to eq(false)
93
-
94
- callback.call(data)
95
- expect(config.performance_stats).to eq(false)
96
- end
97
- # rubocop:enable RSpec/MultipleExpectations
98
- end
99
-
100
- context "when the config enables performance stats" do
101
- before { config.performance_stats = true }
102
-
103
- # rubocop:disable RSpec/MultipleExpectations
104
- it "can disable and enable performance_stats" do
105
- callback = described_class.new(config)
106
-
107
- allow(data).to receive(:performance_stats?).and_return(false)
108
-
109
- callback.call(data)
110
- expect(config.performance_stats).to eq(false)
111
-
112
- allow(data).to receive(:performance_stats?).and_return(true)
113
-
114
- callback.call(data)
115
- expect(config.performance_stats).to eq(true)
116
-
117
- expect(data).to have_received(:performance_stats?).twice
118
- end
119
- # rubocop:enable RSpec/MultipleExpectations
120
- end
121
-
122
- context "when error_host returns a value" do
123
- it "sets the error_host option" do
124
- config.error_host = 'http://api.airbrake.io'
125
- allow(data).to receive(:error_host).and_return('https://api.example.com')
126
-
127
- described_class.new(config).call(data)
128
- expect(config.error_host).to eq('https://api.example.com')
129
- end
130
- end
131
-
132
- context "when error_host returns nil" do
133
- it "doesn't modify the error_host option" do
134
- config.error_host = 'http://api.airbrake.io'
135
- allow(data).to receive(:error_host).and_return(nil)
136
-
137
- described_class.new(config).call(data)
138
- expect(config.error_host).to eq('http://api.airbrake.io')
139
- end
140
- end
141
-
142
- context "when apm_host returns a value" do
143
- it "sets the apm_host option" do
144
- config.apm_host = 'http://api.airbrake.io'
145
- allow(data).to receive(:apm_host).and_return('https://api.example.com')
146
-
147
- described_class.new(config).call(data)
148
- expect(config.apm_host).to eq('https://api.example.com')
149
- end
150
- end
151
-
152
- context "when apm_host returns nil" do
153
- it "doesn't modify the apm_host option" do
154
- config.apm_host = 'http://api.airbrake.io'
155
- allow(data).to receive(:apm_host).and_return(nil)
156
-
157
- described_class.new(config).call(data)
158
- expect(config.apm_host).to eq('http://api.airbrake.io')
159
- end
160
- end
161
- end
162
- end