raygun4ruby 3.0.0 → 3.2.3.pre
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 +5 -5
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.travis.yml +11 -5
- data/CHANGELOG.md +26 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +3 -3
- data/Rakefile +9 -2
- data/examples/sinatras_raygun.rb +0 -0
- data/lib/generators/raygun/install_generator.rb +0 -0
- data/lib/raygun.rb +4 -5
- data/lib/raygun/affected_user.rb +0 -0
- data/lib/raygun/breadcrumbs.rb +0 -0
- data/lib/raygun/breadcrumbs/breadcrumb.rb +4 -0
- data/lib/raygun/breadcrumbs/store.rb +10 -0
- data/lib/raygun/client.rb +4 -1
- data/lib/raygun/configuration.rb +6 -0
- data/lib/raygun/error.rb +0 -0
- data/lib/raygun/javascript_tracker.rb +42 -0
- data/lib/raygun/middleware/breadcrumbs_store_initializer.rb +0 -0
- data/lib/raygun/middleware/javascript_exception_tracking.rb +32 -0
- data/lib/raygun/middleware/rack_exception_interceptor.rb +0 -0
- data/lib/raygun/middleware/rails_insert_affected_user.rb +0 -0
- data/lib/raygun/railtie.rb +2 -1
- data/lib/raygun/services/apply_whitelist_filter_to_payload.rb +0 -0
- data/lib/raygun/sidekiq.rb +3 -0
- data/lib/raygun/testable.rb +0 -0
- data/lib/raygun/version.rb +1 -1
- data/lib/raygun4ruby.rb +0 -0
- data/lib/resque/failure/raygun.rb +0 -0
- data/lib/tasks/raygun.tasks +0 -0
- data/raygun4ruby.gemspec +9 -2
- data/spec/dummy/.gitignore +17 -0
- data/spec/dummy/Gemfile +47 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/home_controller.rb +4 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/home/index.html.erb +3 -0
- data/spec/dummy/app/views/home/index.json.erb +1 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +9 -0
- data/spec/dummy/bin/rake +9 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/bin/spring +17 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +3 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/to_time_preserves_timezone.rb +10 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/seeds.rb +7 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/lib/tasks/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/test/controllers/.keep +0 -0
- data/spec/dummy/test/fixtures/.keep +0 -0
- data/spec/dummy/test/helpers/.keep +0 -0
- data/spec/dummy/test/integration/.keep +0 -0
- data/spec/dummy/test/mailers/.keep +0 -0
- data/spec/dummy/test/models/.keep +0 -0
- data/spec/dummy/test/test_helper.rb +10 -0
- data/spec/dummy/vendor/assets/javascripts/.keep +0 -0
- data/spec/dummy/vendor/assets/stylesheets/.keep +0 -0
- data/spec/features/javascript_spec.rb +48 -0
- data/spec/rails_helper.rb +4 -0
- data/{specs → spec}/raygun/breadcrumbs/breadcrumb_spec.rb +56 -19
- data/{specs → spec}/raygun/breadcrumbs/store_spec.rb +45 -23
- data/{specs → spec}/raygun/raygun_spec.rb +5 -8
- data/{specs → spec}/services/apply_whitelist_filter_to_payload_spec.rb +9 -9
- data/spec/spec_helper.rb +24 -0
- data/spec/support/fake_logger.rb +17 -0
- data/test/integration/client_test.rb +0 -0
- data/test/test_helper.rb +2 -1
- data/test/unit/affected_user_test.rb +0 -0
- data/test/unit/client_test.rb +3 -1
- data/test/unit/configuration_test.rb +12 -0
- data/test/unit/raygun_test.rb +0 -0
- data/test/unit/resque_failure_test.rb +0 -0
- data/test/unit/sidekiq_failure_test.rb +0 -0
- metadata +168 -17
- data/specs/spec_helper.rb +0 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
module Raygun
|
|
4
4
|
module Breadcrumbs
|
|
@@ -10,7 +10,7 @@ module Raygun
|
|
|
10
10
|
|
|
11
11
|
subject.message = message
|
|
12
12
|
|
|
13
|
-
subject.message.
|
|
13
|
+
expect(subject.message).to eq(message)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
it 'has a category' do
|
|
@@ -18,7 +18,7 @@ module Raygun
|
|
|
18
18
|
|
|
19
19
|
subject.category = category
|
|
20
20
|
|
|
21
|
-
subject.category.
|
|
21
|
+
expect(subject.category).to eq(category)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it 'has a level' do
|
|
@@ -26,7 +26,7 @@ module Raygun
|
|
|
26
26
|
|
|
27
27
|
subject.level = level
|
|
28
28
|
|
|
29
|
-
subject.level.
|
|
29
|
+
expect(subject.level).to eq(level)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
it 'has a timestamp' do
|
|
@@ -34,7 +34,7 @@ module Raygun
|
|
|
34
34
|
|
|
35
35
|
subject.timestamp = timestamp
|
|
36
36
|
|
|
37
|
-
subject.timestamp.
|
|
37
|
+
expect(subject.timestamp).to eq(timestamp)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
it 'has metadata' do
|
|
@@ -42,7 +42,7 @@ module Raygun
|
|
|
42
42
|
|
|
43
43
|
subject.metadata = metadata
|
|
44
44
|
|
|
45
|
-
subject.metadata.
|
|
45
|
+
expect(subject.metadata).to eq(metadata)
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
it 'has a class_name' do
|
|
@@ -50,7 +50,7 @@ module Raygun
|
|
|
50
50
|
|
|
51
51
|
subject.class_name = class_name
|
|
52
52
|
|
|
53
|
-
subject.class_name.
|
|
53
|
+
expect(subject.class_name).to eq(class_name)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
it 'has a method_name' do
|
|
@@ -58,7 +58,7 @@ module Raygun
|
|
|
58
58
|
|
|
59
59
|
subject.method_name = method_name
|
|
60
60
|
|
|
61
|
-
subject.method_name.
|
|
61
|
+
expect(subject.method_name).to eq(method_name)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
it 'has a line_number' do
|
|
@@ -66,7 +66,7 @@ module Raygun
|
|
|
66
66
|
|
|
67
67
|
subject.line_number = line_number
|
|
68
68
|
|
|
69
|
-
subject.line_number.
|
|
69
|
+
expect(subject.line_number).to eq(line_number)
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
|
|
@@ -98,35 +98,72 @@ module Raygun
|
|
|
98
98
|
let(:payload) { breadcrumb.build_payload }
|
|
99
99
|
|
|
100
100
|
it "joins the class name, method name and line number together" do
|
|
101
|
-
payload[:location].
|
|
101
|
+
expect(payload[:location]).to eq("HomeController:index:17")
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
it "does not include the method name and line number if the class name is missing" do
|
|
105
105
|
breadcrumb.class_name = nil
|
|
106
106
|
|
|
107
|
-
payload.has_key?(:location).
|
|
107
|
+
expect(payload.has_key?(:location)).to eq(false)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
it "does not inlcude the line number if is it missing" do
|
|
111
111
|
breadcrumb.line_number = nil
|
|
112
112
|
|
|
113
|
-
payload[:location].
|
|
113
|
+
expect(payload[:location]).to eq("HomeController:index")
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
it "does not include keys in payload with nil values" do
|
|
117
117
|
breadcrumb.metadata = nil
|
|
118
118
|
breadcrumb.category = nil
|
|
119
119
|
|
|
120
|
-
payload.key?(:CustomData).
|
|
121
|
-
payload.key?(:category).
|
|
120
|
+
expect(payload.key?(:CustomData)).to eq(false)
|
|
121
|
+
expect(payload.key?(:category)).to eq(false)
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
it 'includes the rest of the fields' do
|
|
125
|
-
payload[:message].
|
|
126
|
-
payload[:category].
|
|
127
|
-
payload[:level].
|
|
128
|
-
payload[:timestamp].
|
|
129
|
-
payload[:CustomData].
|
|
125
|
+
expect(payload[:message]).to eq('test')
|
|
126
|
+
expect(payload[:category]).to eq('test')
|
|
127
|
+
expect(payload[:level]).to eq(1)
|
|
128
|
+
expect(payload[:timestamp]).to_not eq(nil)
|
|
129
|
+
expect(payload[:CustomData]).to eq(foo: 'bar')
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
describe "#size" do
|
|
134
|
+
before do
|
|
135
|
+
Timecop.freeze
|
|
136
|
+
Store.initialize
|
|
137
|
+
end
|
|
138
|
+
after do
|
|
139
|
+
Timecop.return
|
|
140
|
+
Store.clear
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
let(:message) { "This is a breadcrumb message" }
|
|
144
|
+
|
|
145
|
+
let(:breadcrumb) do
|
|
146
|
+
Store.record(
|
|
147
|
+
message: message,
|
|
148
|
+
category: "test",
|
|
149
|
+
level: :info,
|
|
150
|
+
class_name: "HomeController",
|
|
151
|
+
method_name: "index",
|
|
152
|
+
line_number: 17,
|
|
153
|
+
metadata: {
|
|
154
|
+
foo: 'bar'
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
Store.stored[0]
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
let(:size) { breadcrumb.size }
|
|
162
|
+
|
|
163
|
+
it "returns the estimated size of the breadcrumb" do
|
|
164
|
+
# Can't check all the fields but message so assume a standard 100 length for all of them
|
|
165
|
+
# The message should be the bulk of large breadcrumbs anyway
|
|
166
|
+
expect(size).to eq(message.length + 100)
|
|
130
167
|
end
|
|
131
168
|
end
|
|
132
169
|
end
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
require "
|
|
2
|
-
require "minitest/pride"
|
|
3
|
-
require_relative "../../spec_helper"
|
|
1
|
+
require "spec_helper"
|
|
4
2
|
|
|
5
3
|
module Raygun
|
|
6
4
|
module Breadcrumbs
|
|
@@ -10,39 +8,39 @@ module Raygun
|
|
|
10
8
|
|
|
11
9
|
describe "#initialize" do
|
|
12
10
|
before do
|
|
13
|
-
subject.stored.
|
|
11
|
+
expect(subject.stored).to eq(nil)
|
|
14
12
|
|
|
15
13
|
subject.initialize
|
|
16
14
|
end
|
|
17
15
|
|
|
18
16
|
it "creates the store on the current Thread" do
|
|
19
|
-
subject.stored.
|
|
17
|
+
expect(subject.stored).to eq([])
|
|
20
18
|
end
|
|
21
19
|
|
|
22
20
|
it "does not effect other threads" do
|
|
23
21
|
Thread.new do
|
|
24
|
-
subject.stored.
|
|
22
|
+
expect(subject.stored).to eq(nil)
|
|
25
23
|
end.join
|
|
26
24
|
end
|
|
27
25
|
end
|
|
28
26
|
|
|
29
|
-
describe "any?" do
|
|
27
|
+
describe "#any?" do
|
|
30
28
|
it "returns true if any breadcrumbs have been logged" do
|
|
31
29
|
subject.initialize
|
|
32
30
|
|
|
33
31
|
subject.record(message: "test")
|
|
34
32
|
|
|
35
|
-
subject.any
|
|
33
|
+
expect(subject.any?).to eq(true)
|
|
36
34
|
end
|
|
37
35
|
|
|
38
36
|
it "returns false if none have been logged" do
|
|
39
37
|
subject.initialize
|
|
40
38
|
|
|
41
|
-
subject.any
|
|
39
|
+
expect(subject.any?).to eq(false)
|
|
42
40
|
end
|
|
43
41
|
|
|
44
42
|
it "returns false if the store is uninitialized" do
|
|
45
|
-
subject.any
|
|
43
|
+
expect(subject.any?).to eq(false)
|
|
46
44
|
end
|
|
47
45
|
end
|
|
48
46
|
|
|
@@ -54,18 +52,42 @@ module Raygun
|
|
|
54
52
|
it "resets the store back to nil" do
|
|
55
53
|
subject.clear
|
|
56
54
|
|
|
57
|
-
subject.stored.
|
|
55
|
+
expect(subject.stored).to eq(nil)
|
|
58
56
|
end
|
|
59
57
|
end
|
|
60
58
|
|
|
61
59
|
describe "#should_record?" do
|
|
62
60
|
it "returns false when the log level is above the breadcrumbs level" do
|
|
63
|
-
Raygun.configuration.
|
|
61
|
+
allow(Raygun.configuration).to receive(:breadcrumb_level).and_return(:error)
|
|
64
62
|
|
|
65
63
|
crumb = Breadcrumb.new
|
|
66
64
|
crumb.level = :warning
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
expect(subject.send(:should_record?, crumb)).to eq(false)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
describe "#take_until_size" do
|
|
71
|
+
before do
|
|
72
|
+
subject.initialize
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it "takes the most recent breadcrumbs until the size limit is reached" do
|
|
76
|
+
subject.record(message: '1' * 100)
|
|
77
|
+
subject.record(message: '2' * 100)
|
|
78
|
+
subject.record(message: '3' * 100)
|
|
79
|
+
|
|
80
|
+
crumbs = subject.take_until_size(500)
|
|
81
|
+
|
|
82
|
+
expect(crumbs.length).to eq(2)
|
|
83
|
+
expect(crumbs[0].message).to eq('2' * 100)
|
|
84
|
+
expect(crumbs[1].message).to eq('3' * 100)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
it "does not crash with no recorded breadcrumbs" do
|
|
88
|
+
crumbs = subject.take_until_size(500)
|
|
89
|
+
|
|
90
|
+
expect(crumbs).to eq([])
|
|
69
91
|
end
|
|
70
92
|
end
|
|
71
93
|
|
|
@@ -86,28 +108,28 @@ module Raygun
|
|
|
86
108
|
it "gets stored" do
|
|
87
109
|
subject.record(message: "test")
|
|
88
110
|
|
|
89
|
-
subject.stored.length.
|
|
90
|
-
subject.stored[0].message.
|
|
111
|
+
expect(subject.stored.length).to eq(1)
|
|
112
|
+
expect(subject.stored[0].message).to eq("test")
|
|
91
113
|
end
|
|
92
114
|
|
|
93
115
|
it "automatically sets the class name" do
|
|
94
116
|
Foo.new.bar
|
|
95
117
|
|
|
96
118
|
bc = subject.stored[0]
|
|
97
|
-
bc.class_name.
|
|
119
|
+
expect(bc.class_name).to eq("Raygun::Breadcrumbs::Foo")
|
|
98
120
|
end
|
|
99
121
|
|
|
100
122
|
it "automatically sets the method name" do
|
|
101
123
|
Foo.new.bar
|
|
102
124
|
|
|
103
125
|
bc = subject.stored[0]
|
|
104
|
-
bc.method_name.
|
|
126
|
+
expect(bc.method_name).to eq("bar")
|
|
105
127
|
end
|
|
106
128
|
|
|
107
129
|
it "does not set the method name if it is already set" do
|
|
108
130
|
subject.record(message: 'test', method_name: "foo")
|
|
109
131
|
|
|
110
|
-
subject.stored[0].method_name.
|
|
132
|
+
expect(subject.stored[0].method_name).to eq("foo")
|
|
111
133
|
end
|
|
112
134
|
|
|
113
135
|
|
|
@@ -116,7 +138,7 @@ module Raygun
|
|
|
116
138
|
Foo.new.bar
|
|
117
139
|
|
|
118
140
|
bc = subject.stored[0]
|
|
119
|
-
bc.timestamp.
|
|
141
|
+
expect(bc.timestamp).to eq(Time.now.utc.to_i)
|
|
120
142
|
end
|
|
121
143
|
end
|
|
122
144
|
|
|
@@ -126,21 +148,21 @@ module Raygun
|
|
|
126
148
|
Timecop.freeze do
|
|
127
149
|
subject.record(message: 'test', timestamp: time)
|
|
128
150
|
|
|
129
|
-
subject.stored[0].timestamp.
|
|
151
|
+
expect(subject.stored[0].timestamp).to_not eq(Time.now.utc)
|
|
130
152
|
end
|
|
131
153
|
end
|
|
132
154
|
|
|
133
155
|
it "sets the log level to :info if one is not supplied" do
|
|
134
156
|
Foo.new.bar
|
|
135
157
|
|
|
136
|
-
subject.stored[0].level.
|
|
158
|
+
expect(subject.stored[0].level).to eq(:info)
|
|
137
159
|
end
|
|
138
160
|
|
|
139
161
|
it "does not record the breadcrumb if should_record? is false" do
|
|
140
|
-
subject.
|
|
162
|
+
expect(subject).to receive(:should_record?).and_return(false)
|
|
141
163
|
Foo.new.bar
|
|
142
164
|
|
|
143
|
-
subject.stored.length.
|
|
165
|
+
expect(subject.stored.length).to eq(0)
|
|
144
166
|
end
|
|
145
167
|
end
|
|
146
168
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
require 'stringio'
|
|
1
|
+
require 'spec_helper'
|
|
3
2
|
|
|
4
3
|
describe Raygun do
|
|
5
4
|
let(:failsafe_logger) { FakeLogger.new }
|
|
@@ -8,6 +7,7 @@ describe Raygun do
|
|
|
8
7
|
context 'send in background' do
|
|
9
8
|
before do
|
|
10
9
|
Raygun.setup do |c|
|
|
10
|
+
c.silence_reporting = false
|
|
11
11
|
c.send_in_background = true
|
|
12
12
|
c.api_url = 'http://example.api'
|
|
13
13
|
c.api_key = 'foo'
|
|
@@ -28,23 +28,20 @@ describe Raygun do
|
|
|
28
28
|
|
|
29
29
|
# Occasionally doesn't write to the failsafe logger, add small timeout to add some safety
|
|
30
30
|
sleep 0.1
|
|
31
|
-
failsafe_logger.get.
|
|
31
|
+
expect(failsafe_logger.get).to match /Problem reporting exception to Raygun/
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
describe '#reset_configuration' do
|
|
38
|
+
subject { Raygun.reset_configuration }
|
|
38
39
|
it 'clears any customized configuration options' do
|
|
39
40
|
Raygun.setup do |c|
|
|
40
41
|
c.api_url = 'http://test.api'
|
|
41
42
|
end
|
|
42
43
|
|
|
43
|
-
Raygun.configuration.api_url.
|
|
44
|
-
|
|
45
|
-
Raygun.reset_configuration
|
|
46
|
-
|
|
47
|
-
Raygun.configuration.api_url.must_equal Raygun.default_configuration.api_url
|
|
44
|
+
expect { subject }.to change { Raygun.configuration.api_url }.from('http://test.api').to(Raygun.default_configuration.api_url)
|
|
48
45
|
end
|
|
49
46
|
end
|
|
50
47
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
module Raygun
|
|
4
4
|
module Services
|
|
@@ -20,7 +20,7 @@ module Raygun
|
|
|
20
20
|
|
|
21
21
|
new_payload = service.call(shape, payload)
|
|
22
22
|
|
|
23
|
-
new_payload.
|
|
23
|
+
expect(new_payload).to eq(expected)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
it "filters out keys that are set to false" do
|
|
@@ -31,7 +31,7 @@ module Raygun
|
|
|
31
31
|
|
|
32
32
|
new_payload = service.call(shape, payload)
|
|
33
33
|
|
|
34
|
-
new_payload.
|
|
34
|
+
expect(new_payload).to eq(expected)
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -61,7 +61,7 @@ module Raygun
|
|
|
61
61
|
|
|
62
62
|
new_payload = service.call(shape, payload)
|
|
63
63
|
|
|
64
|
-
new_payload.
|
|
64
|
+
expect(new_payload).to eq(expected)
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
it "filters out a nested hash if the whitelist does not contain it" do
|
|
@@ -72,7 +72,7 @@ module Raygun
|
|
|
72
72
|
|
|
73
73
|
new_payload = service.call(shape, payload)
|
|
74
74
|
|
|
75
|
-
new_payload.
|
|
75
|
+
expect(new_payload).to eq(expected)
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
it "handles nested hashes when the whitelist is set to allow the whole hash" do
|
|
@@ -89,7 +89,7 @@ module Raygun
|
|
|
89
89
|
|
|
90
90
|
new_payload = service.call(shape, payload)
|
|
91
91
|
|
|
92
|
-
new_payload.
|
|
92
|
+
expect(new_payload).to eq(expected)
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
it "handles nested hashes when the whitelist is set to not allow the whole hash" do
|
|
@@ -104,7 +104,7 @@ module Raygun
|
|
|
104
104
|
|
|
105
105
|
new_payload = service.call(shape, payload)
|
|
106
106
|
|
|
107
|
-
new_payload.
|
|
107
|
+
expect(new_payload).to eq(expected)
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
110
|
|
|
@@ -124,7 +124,7 @@ module Raygun
|
|
|
124
124
|
|
|
125
125
|
new_payload = service.call(shape, payload)
|
|
126
126
|
|
|
127
|
-
new_payload.
|
|
127
|
+
expect(new_payload).to eq(expected)
|
|
128
128
|
end
|
|
129
129
|
end
|
|
130
130
|
|
|
@@ -244,7 +244,7 @@ module Raygun
|
|
|
244
244
|
|
|
245
245
|
new_payload = service.call(shape, payload)
|
|
246
246
|
|
|
247
|
-
new_payload.
|
|
247
|
+
expect(new_payload).to eq(expected)
|
|
248
248
|
end
|
|
249
249
|
end
|
|
250
250
|
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#require 'rubygems'
|
|
2
|
+
|
|
3
|
+
require 'timecop'
|
|
4
|
+
require 'webmock/rspec'
|
|
5
|
+
|
|
6
|
+
# Coverage
|
|
7
|
+
require 'simplecov'
|
|
8
|
+
SimpleCov.start do
|
|
9
|
+
add_filter '/spec/'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
require 'support/fake_logger'
|
|
13
|
+
|
|
14
|
+
RSpec.configure do |config|
|
|
15
|
+
# Enable flags like --only-failures and --next-failure
|
|
16
|
+
# config.example_status_persistence_file_path = ".rspec_status"
|
|
17
|
+
|
|
18
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
|
19
|
+
# config.disable_monkey_patching!
|
|
20
|
+
|
|
21
|
+
config.expect_with :rspec do |c|
|
|
22
|
+
c.syntax = :expect
|
|
23
|
+
end
|
|
24
|
+
end
|