exceptionally 1.4.4 → 1.5.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/README.md +11 -15
- data/lib/exceptionally/controller.rb +9 -11
- data/lib/exceptionally/handler.rb +0 -7
- data/lib/exceptionally/version.rb +1 -1
- data/lib/exceptionally.rb +0 -9
- data/spec/dummy/config/initializers/assets.rb +1 -1
- data/spec/dummy/log/test.log +1667 -0
- data/spec/exceptionally/handler_spec.rb +1 -39
- data/spec/spec_helper.rb +1 -7
- metadata +7 -7
- data/spec/exceptionally/config_spec.rb +0 -11
@@ -18,7 +18,7 @@ describe ActionController, :type => :controller do
|
|
18
18
|
temp_params = params
|
19
19
|
end
|
20
20
|
|
21
|
-
get :index, username: 'bob', password: '123456'
|
21
|
+
get :index, params: {username: 'bob', password: '123456'}
|
22
22
|
expect(temp_params['username']).to eq('bob')
|
23
23
|
expect(temp_params['password']).to eq('[FILTERED]')
|
24
24
|
end
|
@@ -60,42 +60,4 @@ describe ActionController, :type => :controller do
|
|
60
60
|
get :index
|
61
61
|
expect(temp_message).to eq(nil)
|
62
62
|
end
|
63
|
-
|
64
|
-
describe 'when only Raven is defined' do
|
65
|
-
describe 'and report_errors is true' do
|
66
|
-
before do
|
67
|
-
Exceptionally.report_errors = true
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'reports errors for a 500 error' do
|
71
|
-
expect(Raven).to receive(:capture_exception)
|
72
|
-
get :index
|
73
|
-
end
|
74
|
-
|
75
|
-
it 'does not report errors for a 400 error' do
|
76
|
-
allow(controller).to receive(:index).and_raise(Exceptionally::BadRequest.new)
|
77
|
-
|
78
|
-
expect(Raven).to_not receive(:capture_exception)
|
79
|
-
get :index
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'does not report errors to Airbrake' do
|
83
|
-
expect(Airbrake).to receive(:respond_to?).at_least(:once)
|
84
|
-
expect(Airbrake).to_not receive(:notify)
|
85
|
-
|
86
|
-
get :index
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
describe 'and report_errors is false' do
|
91
|
-
before do
|
92
|
-
Exceptionally.report_errors = false
|
93
|
-
end
|
94
|
-
|
95
|
-
it 'does not report errors for a 500 error' do
|
96
|
-
expect(Raven).to_not receive(:capture_exception)
|
97
|
-
get :index
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
63
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,8 +3,8 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
|
3
3
|
ENV['RAILS_ENV'] ||= 'test'
|
4
4
|
|
5
5
|
require 'rails'
|
6
|
-
require 'active_record/errors'
|
7
6
|
require 'active_model'
|
7
|
+
require 'active_record/errors'
|
8
8
|
require 'action_view'
|
9
9
|
require 'action_controller'
|
10
10
|
require 'dummy/config/environment'
|
@@ -16,9 +16,3 @@ RSpec.configure do |c|
|
|
16
16
|
c.infer_base_class_for_anonymous_controllers = false
|
17
17
|
c.order = 'random'
|
18
18
|
end
|
19
|
-
|
20
|
-
class Raven
|
21
|
-
def capture_exception(error); end
|
22
|
-
end
|
23
|
-
|
24
|
-
class Airbrake; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptionally
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 3.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 3.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rspec-rails
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -85,12 +85,12 @@ files:
|
|
85
85
|
- spec/dummy/config/locales/en.yml
|
86
86
|
- spec/dummy/config/routes.rb
|
87
87
|
- spec/dummy/config/secrets.yml
|
88
|
+
- spec/dummy/log/test.log
|
88
89
|
- spec/dummy/public/404.html
|
89
90
|
- spec/dummy/public/422.html
|
90
91
|
- spec/dummy/public/500.html
|
91
92
|
- spec/dummy/public/favicon.ico
|
92
93
|
- spec/dummy/version.rb
|
93
|
-
- spec/exceptionally/config_spec.rb
|
94
94
|
- spec/exceptionally/controller_spec.rb
|
95
95
|
- spec/exceptionally/handler_spec.rb
|
96
96
|
- spec/spec_helper.rb
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
|
-
rubygems_version: 3.
|
116
|
+
rubygems_version: 3.4.10
|
117
117
|
signing_key:
|
118
118
|
specification_version: 4
|
119
119
|
summary: Exceptionally simple Rails Exception library
|
@@ -144,12 +144,12 @@ test_files:
|
|
144
144
|
- spec/dummy/config/routes.rb
|
145
145
|
- spec/dummy/config/secrets.yml
|
146
146
|
- spec/dummy/config.ru
|
147
|
+
- spec/dummy/log/test.log
|
147
148
|
- spec/dummy/public/404.html
|
148
149
|
- spec/dummy/public/422.html
|
149
150
|
- spec/dummy/public/500.html
|
150
151
|
- spec/dummy/public/favicon.ico
|
151
152
|
- spec/dummy/version.rb
|
152
|
-
- spec/exceptionally/config_spec.rb
|
153
153
|
- spec/exceptionally/controller_spec.rb
|
154
154
|
- spec/exceptionally/handler_spec.rb
|
155
155
|
- spec/spec_helper.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Exceptionally do
|
4
|
-
it 'saves report_errors' do
|
5
|
-
Exceptionally.report_errors = true
|
6
|
-
expect(Exceptionally.report_errors).to eq(true)
|
7
|
-
|
8
|
-
Exceptionally.report_errors = false
|
9
|
-
expect(Exceptionally.report_errors).to eq(false)
|
10
|
-
end
|
11
|
-
end
|