exception_handling 2.6.0 → 2.8.0
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/.gitignore +1 -1
- data/.jenkins/Jenkinsfile +24 -8
- data/.rspec +3 -0
- data/CHANGELOG.md +18 -1
- data/Gemfile +4 -4
- data/Gemfile.lock +66 -57
- data/Rakefile +7 -6
- data/gemfiles/rails_4.gemfile +4 -4
- data/gemfiles/rails_5.gemfile +4 -4
- data/gemfiles/rails_6.gemfile +4 -4
- data/lib/exception_handling.rb +5 -2
- data/lib/exception_handling/exception_info.rb +3 -6
- data/lib/exception_handling/log_stub_error.rb +2 -1
- data/lib/exception_handling/logging_methods.rb +27 -0
- data/lib/exception_handling/methods.rb +6 -53
- data/lib/exception_handling/testing.rb +20 -10
- data/lib/exception_handling/version.rb +1 -1
- data/{test → spec}/helpers/controller_helpers.rb +0 -0
- data/{test → spec}/helpers/exception_helpers.rb +2 -2
- data/{test → spec}/rake_test_warning_false.rb +0 -0
- data/{test/test_helper.rb → spec/spec_helper.rb} +50 -39
- data/spec/unit/exception_handling/exception_catalog_spec.rb +85 -0
- data/spec/unit/exception_handling/exception_description_spec.rb +82 -0
- data/{test/unit/exception_handling/exception_info_test.rb → spec/unit/exception_handling/exception_info_spec.rb} +118 -99
- data/{test/unit/exception_handling/honeybadger_callbacks_test.rb → spec/unit/exception_handling/honeybadger_callbacks_spec.rb} +20 -20
- data/{test/unit/exception_handling/log_error_stub_test.rb → spec/unit/exception_handling/log_error_stub_spec.rb} +38 -22
- data/spec/unit/exception_handling/logging_methods_spec.rb +38 -0
- data/{test/unit/exception_handling/mailer_test.rb → spec/unit/exception_handling/mailer_spec.rb} +17 -17
- data/spec/unit/exception_handling/methods_spec.rb +105 -0
- data/spec/unit/exception_handling/sensu_spec.rb +51 -0
- data/{test/unit/exception_handling_test.rb → spec/unit/exception_handling_spec.rb} +348 -329
- metadata +32 -28
- data/test/unit/exception_handling/exception_catalog_test.rb +0 -85
- data/test/unit/exception_handling/exception_description_test.rb +0 -82
- data/test/unit/exception_handling/methods_test.rb +0 -84
- data/test/unit/exception_handling/sensu_test.rb +0 -52
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require File.expand_path('../../
|
3
|
+
require File.expand_path('../../spec_helper', __dir__)
|
4
4
|
|
5
5
|
module ExceptionHandling
|
6
|
-
|
6
|
+
describe HoneybadgerCallbacks do
|
7
7
|
|
8
8
|
class TestPoroWithAttribute
|
9
9
|
attr_reader :test_attribute
|
@@ -55,15 +55,15 @@ module ExceptionHandling
|
|
55
55
|
end
|
56
56
|
|
57
57
|
context "register_callbacks" do
|
58
|
-
|
58
|
+
it "store the callbacks in the honeybadger object" do
|
59
59
|
HoneybadgerCallbacks.register_callbacks
|
60
60
|
result = Honeybadger.config.local_variable_filter.call(:variable_name, 'test', [])
|
61
|
-
|
61
|
+
expect(result).to eq('test')
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
65
|
context "local_variable_filter" do
|
66
|
-
|
66
|
+
it "not inspect String, Hash, Array, Set, Numeric, TrueClass, FalseClass, NilClass" do
|
67
67
|
[
|
68
68
|
['test', String],
|
69
69
|
[{ a: 1 }, Hash],
|
@@ -75,46 +75,46 @@ module ExceptionHandling
|
|
75
75
|
[nil, NilClass]
|
76
76
|
].each do |object, expected_class|
|
77
77
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, object, [])
|
78
|
-
|
78
|
+
expect(result.is_a?(expected_class)).to be_truthy
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
-
|
82
|
+
it "inspect other classes" do
|
83
83
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, TestPoroWithAttribute.new, ['password'])
|
84
|
-
|
84
|
+
expect(result).to match(/#<ExceptionHandling::TestPoroWithAttribute:.* @test_attribute="test">/)
|
85
85
|
end
|
86
86
|
|
87
87
|
context "when inspect raises exceptions" do
|
88
|
-
|
88
|
+
it "handle exceptions for objects" do
|
89
89
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, TestRaiseOnInspect.new, ['password'])
|
90
|
-
|
90
|
+
expect(result).to eq("#<ExceptionHandling::TestRaiseOnInspect [error 'RuntimeError: some error' while calling #inspect]>")
|
91
91
|
end
|
92
92
|
|
93
|
-
|
93
|
+
it "handle exceptions for objects responding to id" do
|
94
94
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, TestRaiseOnInspectWithId.new, ['password'])
|
95
|
-
|
95
|
+
expect(result).to eq("#<ExceptionHandling::TestRaiseOnInspectWithId @id=123 [error 'RuntimeError: some error' while calling #inspect]>")
|
96
96
|
end
|
97
97
|
|
98
|
-
|
98
|
+
it "handle exceptions for objects responding to to_pk" do
|
99
99
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, TestRaiseOnInspectWithToPk.new, ['password'])
|
100
|
-
|
100
|
+
expect(result).to eq("#<ExceptionHandling::TestRaiseOnInspectWithToPk @pk=SomeRecord-123 [error 'RuntimeError: some error' while calling #inspect]>")
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
104
|
context "not inspect objects that contain filter keys" do
|
105
|
-
|
105
|
+
it "use to_pk if available, even if id is available" do
|
106
106
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, TestPoroWithFilteredAttributePkAndId.new, ['password'])
|
107
|
-
|
107
|
+
expect(result).to match(/#<ExceptionHandling::TestPoroWithFilteredAttributePkAndId @pk=TestPoroWithFilteredAttributePkAndId_1, \[FILTERED\]>/)
|
108
108
|
end
|
109
109
|
|
110
|
-
|
110
|
+
it "use id if to_pk is not available" do
|
111
111
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, TestPoroWithFilteredAttributeAndId.new, ['password'])
|
112
|
-
|
112
|
+
expect(result).to match(/#<ExceptionHandling::TestPoroWithFilteredAttributeAndId @id=1, \[FILTERED\]>/)
|
113
113
|
end
|
114
114
|
|
115
|
-
|
115
|
+
it "print the object name if no id or to_pk" do
|
116
116
|
result = HoneybadgerCallbacks.send(:local_variable_filter, :variable_name, TestPoroWithFilteredAttribute.new, ['password'])
|
117
|
-
|
117
|
+
expect(result).to match(/#<ExceptionHandling::TestPoroWithFilteredAttribute \[FILTERED\]>/)
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -1,27 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require File.expand_path('../../
|
3
|
+
require File.expand_path('../../spec_helper', __dir__)
|
4
4
|
|
5
5
|
module ExceptionHandling
|
6
|
-
|
6
|
+
describe LogErrorStub do
|
7
7
|
|
8
8
|
include LogErrorStub
|
9
9
|
|
10
10
|
context "while running tests" do
|
11
|
-
|
11
|
+
before do
|
12
12
|
setup_log_error_stub
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
after do
|
16
16
|
teardown_log_error_stub
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
it "raise an error when log_error and log_warning are called" do
|
20
20
|
begin
|
21
21
|
ExceptionHandling.log_error("Something happened")
|
22
22
|
flunk
|
23
23
|
rescue Exception => ex # LogErrorStub::UnexpectedExceptionLogged => ex
|
24
|
-
|
24
|
+
expect(ex.to_s.starts_with?("StandardError: Something happened")).to be_truthy
|
25
25
|
end
|
26
26
|
|
27
27
|
begin
|
@@ -31,16 +31,16 @@ module ExceptionHandling
|
|
31
31
|
begin
|
32
32
|
ExceptionHandling.log_error(ex)
|
33
33
|
rescue LogErrorStub::UnexpectedExceptionLogged => ex
|
34
|
-
|
34
|
+
expect(ex.to_s.starts_with?("RaisedError: This should raise")).to be_truthy
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
|
39
|
+
it "allow for the regex specification of an expected exception to be ignored" do
|
40
40
|
exception_pattern = /StandardError: This is a test error/
|
41
|
-
|
41
|
+
expect(exception_whitelist).to be_nil # test that exception expectations are cleared
|
42
42
|
expects_exception(exception_pattern)
|
43
|
-
|
43
|
+
expect(exception_whitelist[0][0]).to eq(exception_pattern)
|
44
44
|
begin
|
45
45
|
ExceptionHandling.log_error("This is a test error")
|
46
46
|
rescue StandardError
|
@@ -48,11 +48,11 @@ module ExceptionHandling
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
|
51
|
+
it "allow for the string specification of an expected exception to be ignored" do
|
52
52
|
exception_pattern = "StandardError: This is a test error"
|
53
|
-
|
53
|
+
expect(exception_whitelist).to be_nil # test that exception expectations are cleared
|
54
54
|
expects_exception(exception_pattern)
|
55
|
-
|
55
|
+
expect(exception_whitelist[0][0]).to eq(exception_pattern)
|
56
56
|
begin
|
57
57
|
ExceptionHandling.log_error("This is a test error")
|
58
58
|
rescue StandardError
|
@@ -60,9 +60,9 @@ module ExceptionHandling
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
|
63
|
+
it "allow multiple errors to be ignored" do
|
64
64
|
class IgnoredError < StandardError; end
|
65
|
-
|
65
|
+
expect(exception_whitelist).to be_nil # test that exception expectations are cleared
|
66
66
|
expects_exception(/StandardError: This is a test error/)
|
67
67
|
expects_exception(/IgnoredError: This should be ignored/)
|
68
68
|
ExceptionHandling.log_error("This is a test error")
|
@@ -73,7 +73,7 @@ module ExceptionHandling
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
|
76
|
+
it "expect exception twice if declared twice" do
|
77
77
|
expects_exception(/StandardError: ERROR: I love lamp/)
|
78
78
|
expects_exception(/StandardError: ERROR: I love lamp/)
|
79
79
|
ExceptionHandling.log_error("ERROR: I love lamp")
|
@@ -82,23 +82,39 @@ module ExceptionHandling
|
|
82
82
|
end
|
83
83
|
|
84
84
|
context "teardown_log_error_stub" do
|
85
|
-
|
85
|
+
before do
|
86
|
+
RSpec.configure do |config|
|
87
|
+
config.mock_with :rspec do |mocks|
|
88
|
+
mocks.verify_partial_doubles = false
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
after do
|
94
|
+
RSpec.configure do |config|
|
95
|
+
config.mock_with :rspec do |mocks|
|
96
|
+
mocks.verify_partial_doubles = true
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
it "support MiniTest framework for adding a failure" do
|
86
102
|
expects_exception(/foo/)
|
87
103
|
|
88
|
-
|
104
|
+
expect(self).to receive(:is_mini_test?) { true }
|
89
105
|
|
90
|
-
|
106
|
+
expect(self).to receive(:flunk).with("log_error expected 1 times with pattern: 'foo' found 0")
|
91
107
|
teardown_log_error_stub
|
92
108
|
|
93
109
|
self.exception_whitelist = nil
|
94
110
|
end
|
95
111
|
|
96
|
-
|
112
|
+
it "support Test::Unit framework for adding a failure" do
|
97
113
|
expects_exception(/foo/)
|
98
114
|
|
99
|
-
|
115
|
+
expect(self).to receive(:is_mini_test?) { false }
|
100
116
|
|
101
|
-
|
117
|
+
expect(self).to receive(:add_failure).with("log_error expected 1 times with pattern: 'foo' found 0")
|
102
118
|
teardown_log_error_stub
|
103
119
|
|
104
120
|
self.exception_whitelist = nil
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path('../../spec_helper', __dir__)
|
4
|
+
|
5
|
+
require_relative '../../helpers/exception_helpers'
|
6
|
+
|
7
|
+
require "exception_handling/testing"
|
8
|
+
|
9
|
+
module ExceptionHandling
|
10
|
+
describe LoggingMethods do
|
11
|
+
include ExceptionHelpers
|
12
|
+
|
13
|
+
def dont_stub_log_error
|
14
|
+
true
|
15
|
+
end
|
16
|
+
|
17
|
+
context "ExceptionHandling::LoggingMethods" do
|
18
|
+
before do
|
19
|
+
@controller = Testing::LoggingMethodsControllerStub.new
|
20
|
+
ExceptionHandling.stub_handler = nil
|
21
|
+
end
|
22
|
+
|
23
|
+
context "#log_warning" do
|
24
|
+
it "be available to the controller" do
|
25
|
+
klass = Class.new
|
26
|
+
klass.include ExceptionHandling::LoggingMethods
|
27
|
+
instance = klass.new
|
28
|
+
expect(instance.methods.include?(:log_warning)).to eq(true)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "call ExceptionHandling#log_warning" do
|
32
|
+
expect(ExceptionHandling).to receive(:log_warning).with("Hi mom")
|
33
|
+
@controller.send(:log_warning, "Hi mom")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/{test/unit/exception_handling/mailer_test.rb → spec/unit/exception_handling/mailer_spec.rb}
RENAMED
@@ -1,19 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require File.expand_path('../../
|
3
|
+
require File.expand_path('../../spec_helper', __dir__)
|
4
|
+
require 'rails-dom-testing'
|
4
5
|
|
5
6
|
module ExceptionHandling
|
6
|
-
|
7
|
+
describe Mailer do
|
7
8
|
|
8
9
|
include ::Rails::Dom::Testing::Assertions::SelectorAssertions
|
9
|
-
tests ExceptionHandling::Mailer
|
10
10
|
|
11
11
|
def dont_stub_log_error
|
12
12
|
true
|
13
13
|
end
|
14
14
|
|
15
15
|
context "ExceptionHandling::Mailer" do
|
16
|
-
|
16
|
+
before do
|
17
17
|
ExceptionHandling.email_environment = 'Test'
|
18
18
|
ExceptionHandling.sender_address = %("Test Exception Mailer" <null_exception@invoca.com>)
|
19
19
|
ExceptionHandling.exception_recipients = ['test_exception@invoca.com']
|
@@ -21,22 +21,22 @@ module ExceptionHandling
|
|
21
21
|
end
|
22
22
|
|
23
23
|
context "log_parser_exception_notification" do
|
24
|
-
|
24
|
+
it "send with string" do
|
25
25
|
result = ExceptionHandling::Mailer.log_parser_exception_notification("This is my fake error", "My Fake Subj").deliver_now
|
26
|
-
|
27
|
-
|
26
|
+
expect(result.subject).to eq("Test exception: My Fake Subj: This is my fake error")
|
27
|
+
expect(result.body.to_s).to match(/This is my fake error/)
|
28
28
|
assert_emails 1
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
32
|
context "escalation_notification" do
|
33
|
-
|
33
|
+
before do
|
34
34
|
def document_root_element
|
35
35
|
@body_html.root
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
-
|
39
|
+
it "send all the information" do
|
40
40
|
ExceptionHandling.email_environment = 'Staging Full'
|
41
41
|
ExceptionHandling.server_name = 'test-fe3'
|
42
42
|
|
@@ -46,8 +46,8 @@ module ExceptionHandling
|
|
46
46
|
result = ActionMailer::Base.deliveries.last
|
47
47
|
@body_html = Nokogiri::HTML(result.body.to_s)
|
48
48
|
assert_equal_with_diff ['test_escalation@invoca.com'], result.to
|
49
|
-
|
50
|
-
|
49
|
+
expect(result[:from].formatted).to eq(["Test Escalation Mailer <null_escalation@invoca.com>"])
|
50
|
+
expect(result.subject).to eq("Staging Full Escalation: Your Favorite <b>Feature<b> Failed")
|
51
51
|
assert_select "title", "Exception Escalation"
|
52
52
|
assert_select "html" do
|
53
53
|
assert_select "body br", { count: 4 }, result.body.to_s # plus 1 for the multiline summary
|
@@ -60,13 +60,13 @@ module ExceptionHandling
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
|
63
|
+
it "use defaults for missing fields" do
|
64
64
|
result = ExceptionHandling::Mailer.escalation_notification("Your Favorite Feature Failed", error_string: "It failed because of an error\n More Info")
|
65
65
|
@body_html = Nokogiri::HTML(result.body.to_s)
|
66
66
|
|
67
67
|
assert_equal_with_diff ['test_escalation@invoca.com'], result.to
|
68
|
-
|
69
|
-
|
68
|
+
expect(result.from).to eq(["null_escalation@invoca.com"])
|
69
|
+
expect(result.subject).to eq('Test Escalation: Your Favorite Feature Failed')
|
70
70
|
assert_select "html" do
|
71
71
|
assert_select "body i", true, result.body.to_s do |is|
|
72
72
|
assert_select is, "i", 'no error #'
|
@@ -75,11 +75,11 @@ module ExceptionHandling
|
|
75
75
|
end
|
76
76
|
|
77
77
|
context "ExceptionHandling.escalate_to_production_support" do
|
78
|
-
|
78
|
+
before do
|
79
79
|
Time.now_override = Time.parse('1986-5-21 4:17 am UTC')
|
80
80
|
end
|
81
81
|
|
82
|
-
|
82
|
+
it "notify production support" do
|
83
83
|
subject = "Runtime Error found!"
|
84
84
|
exception = RuntimeError.new("Test")
|
85
85
|
recipients = ["prodsupport@example.com"]
|
@@ -87,7 +87,7 @@ module ExceptionHandling
|
|
87
87
|
ExceptionHandling.production_support_recipients = recipients
|
88
88
|
ExceptionHandling.last_exception_timestamp = Time.now.to_i
|
89
89
|
|
90
|
-
|
90
|
+
expect(ExceptionHandling).to receive(:escalate).with(subject, exception, Time.now.to_i, recipients)
|
91
91
|
ExceptionHandling.escalate_to_production_support(exception, subject)
|
92
92
|
end
|
93
93
|
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path('../../spec_helper', __dir__)
|
4
|
+
|
5
|
+
require "exception_handling/testing"
|
6
|
+
require_relative '../../helpers/exception_helpers.rb'
|
7
|
+
|
8
|
+
module ExceptionHandling
|
9
|
+
describe Methods do
|
10
|
+
include ExceptionHelpers
|
11
|
+
|
12
|
+
def dont_stub_log_error
|
13
|
+
true
|
14
|
+
end
|
15
|
+
|
16
|
+
context "ExceptionHandling::Methods" do
|
17
|
+
before do
|
18
|
+
@controller = Testing::MethodsControllerStub.new
|
19
|
+
ExceptionHandling.stub_handler = nil
|
20
|
+
end
|
21
|
+
|
22
|
+
it "set the around filter" do
|
23
|
+
expect(Testing::MethodsControllerStub.around_filter_method).to eq(:set_current_controller)
|
24
|
+
expect(ExceptionHandling.current_controller).to be_nil
|
25
|
+
@controller.simulate_around_filter do
|
26
|
+
expect(ExceptionHandling.current_controller).to eq(@controller)
|
27
|
+
end
|
28
|
+
expect(ExceptionHandling.current_controller).to be_nil
|
29
|
+
end
|
30
|
+
|
31
|
+
it "use the current_controller when available" do
|
32
|
+
capture_notifications
|
33
|
+
|
34
|
+
expect(ExceptionHandling.logger).to receive(:fatal).with(/blah/, anything).at_least(:once)
|
35
|
+
@controller.simulate_around_filter do
|
36
|
+
ExceptionHandling.log_error(ArgumentError.new("blah"))
|
37
|
+
expect(sent_notifications.size).to eq(1)
|
38
|
+
expect(/#{Regexp.new(Regexp.escape(@controller.request.request_uri))}/).to match(sent_notifications.last.enhanced_data['request'].to_s)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it "report long running controller action" do
|
43
|
+
expect(@controller.send(:long_controller_action_timeout)).to eq(2)
|
44
|
+
expect(ExceptionHandling).to receive(:log_error).with(/Long controller action detected in #{@controller.class.name.split("::").last}::test_action/)
|
45
|
+
@controller.simulate_around_filter do
|
46
|
+
sleep(3)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
it "not report long running controller actions if it is less than the timeout" do
|
51
|
+
expect(@controller.send(:long_controller_action_timeout)).to eq(2)
|
52
|
+
allow(ExceptionHandling).to receive(:log_error).and_return("Should not timeout")
|
53
|
+
@controller.simulate_around_filter do
|
54
|
+
sleep(1)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
it "default long running controller action(300/30 for test/prod)" do
|
59
|
+
class DummyController
|
60
|
+
include ExceptionHandling::Methods
|
61
|
+
end
|
62
|
+
|
63
|
+
controller = DummyController.new
|
64
|
+
|
65
|
+
Rails.env = 'production'
|
66
|
+
expect(controller.send(:long_controller_action_timeout)).to eq(30)
|
67
|
+
|
68
|
+
Rails.env = 'test'
|
69
|
+
expect(controller.send(:long_controller_action_timeout)).to eq(300)
|
70
|
+
end
|
71
|
+
|
72
|
+
context "#log_warning" do
|
73
|
+
it "be available to the controller" do
|
74
|
+
expect(@controller.methods.include?(:log_warning)).to eq(true)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context "included deprecation" do
|
79
|
+
before do
|
80
|
+
mock_deprecation_3_0
|
81
|
+
end
|
82
|
+
|
83
|
+
it "deprecate when no around_filter in included hook" do
|
84
|
+
k = Class.new
|
85
|
+
k.include ExceptionHandling::Methods
|
86
|
+
end
|
87
|
+
|
88
|
+
it "deprecate controller around_filter in included hook" do
|
89
|
+
controller = Class.new
|
90
|
+
class << controller
|
91
|
+
def around_filter(*)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
controller.include ExceptionHandling::Methods
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
private
|
99
|
+
|
100
|
+
def mock_deprecation_3_0
|
101
|
+
expect(STDERR).to receive(:puts).with(/DEPRECATION WARNING: ExceptionHandling::Methods is deprecated and will be removed from exception_handling 3\.0/)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|