bugsnag 1.8.6 → 1.8.7
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 +2 -1
- data/CHANGELOG.md +7 -0
- data/README.md +11 -5
- data/VERSION +1 -1
- data/bugsnag.gemspec +2 -1
- data/lib/bugsnag/notification.rb +15 -1
- data/lib/bugsnag/tasks/bugsnag.cap +4 -1
- data/lib/bugsnag/tasks/bugsnag.rake +15 -11
- data/spec/helper_spec.rb +30 -30
- data/spec/middleware_spec.rb +37 -39
- data/spec/notification_spec.rb +227 -212
- data/spec/rack_spec.rb +9 -9
- data/spec/spec_helper.rb +4 -2
- metadata +24 -24
data/spec/rack_spec.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Bugsnag::Rack do
|
4
|
-
it "
|
4
|
+
it "calls the upstream rack app with the environment" do
|
5
5
|
rack_env = {"key" => "value"}
|
6
6
|
app = lambda { |env| ['response', {}, env] }
|
7
7
|
rack_stack = Bugsnag::Rack.new(app)
|
8
8
|
|
9
9
|
response = rack_stack.call(rack_env)
|
10
10
|
|
11
|
-
response.
|
11
|
+
expect(response).to eq(['response', {}, rack_env])
|
12
12
|
end
|
13
13
|
|
14
14
|
context "when an exception is raised in rack middleware" do
|
@@ -18,27 +18,27 @@ describe Bugsnag::Rack do
|
|
18
18
|
app = lambda { |env| raise exception }
|
19
19
|
rack_stack = Bugsnag::Rack.new(app)
|
20
20
|
|
21
|
-
it "
|
21
|
+
it "re-raises the exception" do
|
22
22
|
expect { rack_stack.call(rack_env) }.to raise_error(BugsnagTestException)
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
26
|
-
Bugsnag::Notification.
|
25
|
+
it "delivers an exception if auto_notify is enabled" do
|
26
|
+
expect(Bugsnag::Notification).to receive(:deliver_exception_payload) do |endpoint, payload|
|
27
27
|
exception_class = payload[:events].first[:exceptions].first[:errorClass]
|
28
|
-
exception_class.
|
28
|
+
expect(exception_class).to eq(exception.class.to_s)
|
29
29
|
end
|
30
30
|
|
31
31
|
rack_stack.call(rack_env) rescue nil
|
32
32
|
end
|
33
33
|
|
34
|
-
it "
|
34
|
+
it "does not deliver an exception if auto_notify is disabled" do
|
35
35
|
Bugsnag.configure do |config|
|
36
36
|
config.auto_notify = false
|
37
37
|
end
|
38
38
|
|
39
|
-
Bugsnag::Notification.
|
39
|
+
expect(Bugsnag::Notification).not_to receive(:deliver_exception_payload)
|
40
40
|
|
41
41
|
rack_stack.call(rack_env) rescue nil
|
42
42
|
end
|
43
43
|
end
|
44
|
-
end
|
44
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,13 +3,13 @@ require 'bugsnag'
|
|
3
3
|
class BugsnagTestException < RuntimeError; end
|
4
4
|
|
5
5
|
def get_event_from_payload(payload)
|
6
|
-
payload[:events].
|
6
|
+
expect(payload[:events].size).to eq(1)
|
7
7
|
payload[:events].first
|
8
8
|
end
|
9
9
|
|
10
10
|
def get_exception_from_payload(payload)
|
11
11
|
event = get_event_from_payload(payload)
|
12
|
-
event[:exceptions].
|
12
|
+
expect(event[:exceptions].size).to eq(1)
|
13
13
|
event[:exceptions].last
|
14
14
|
end
|
15
15
|
|
@@ -21,6 +21,8 @@ RSpec.configure do |config|
|
|
21
21
|
Bugsnag.configure do |config|
|
22
22
|
config.api_key = "c9d60ae4c7e70c4b6c4ebd3e8056d2b8"
|
23
23
|
config.release_stage = "production"
|
24
|
+
# silence logger in tests
|
25
|
+
config.logger = Logger.new(StringIO.new)
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
metadata
CHANGED
@@ -1,89 +1,89 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httparty
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - <
|
31
|
+
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.0'
|
34
|
-
- -
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '0.6'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- - <
|
41
|
+
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '1.0'
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0.6'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
48
|
+
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- -
|
72
|
+
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: rdoc
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- -
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- -
|
86
|
+
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
description: Ruby notifier for bugsnag.com
|
@@ -94,10 +94,10 @@ extra_rdoc_files:
|
|
94
94
|
- LICENSE.txt
|
95
95
|
- README.md
|
96
96
|
files:
|
97
|
-
- .document
|
98
|
-
- .gitignore
|
99
|
-
- .rspec
|
100
|
-
- .travis.yml
|
97
|
+
- ".document"
|
98
|
+
- ".gitignore"
|
99
|
+
- ".rspec"
|
100
|
+
- ".travis.yml"
|
101
101
|
- CHANGELOG.md
|
102
102
|
- Gemfile
|
103
103
|
- LICENSE.txt
|
@@ -151,17 +151,17 @@ require_paths:
|
|
151
151
|
- lib
|
152
152
|
required_ruby_version: !ruby/object:Gem::Requirement
|
153
153
|
requirements:
|
154
|
-
- -
|
154
|
+
- - ">="
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: '0'
|
157
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
|
-
- -
|
159
|
+
- - ">="
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.0
|
164
|
+
rubygems_version: 2.2.0
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Ruby notifier for bugsnag.com
|