honeybadger 1.8.1 → 1.9.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/CHANGELOG.md +14 -0
  2. data/Gemfile.lock +61 -19
  3. data/Guardfile +4 -4
  4. data/MIT-LICENSE +1 -0
  5. data/README.md +2 -2
  6. data/Rakefile +4 -14
  7. data/features/rails.feature +1 -1
  8. data/gemfiles/rack.gemfile.lock +62 -27
  9. data/gemfiles/rails2.3.gemfile.lock +73 -36
  10. data/gemfiles/rails3.0.gemfile.lock +59 -26
  11. data/gemfiles/rails3.1.gemfile.lock +59 -26
  12. data/gemfiles/rails3.2.gemfile.lock +63 -30
  13. data/gemfiles/rails4.gemfile.lock +69 -36
  14. data/gemfiles/rake.gemfile.lock +62 -27
  15. data/gemfiles/sinatra.gemfile.lock +62 -27
  16. data/honeybadger.gemspec +31 -17
  17. data/lib/honeybadger.rb +2 -3
  18. data/lib/honeybadger/array.rb +53 -0
  19. data/lib/honeybadger/configuration.rb +19 -2
  20. data/lib/honeybadger/monitor.rb +16 -0
  21. data/lib/honeybadger/monitor/railtie.rb +52 -0
  22. data/lib/honeybadger/monitor/sender.rb +33 -0
  23. data/lib/honeybadger/monitor/worker.rb +71 -0
  24. data/lib/honeybadger/railtie.rb +10 -0
  25. data/lib/honeybadger/sender.rb +60 -41
  26. data/{test/unit/backtrace_test.rb → spec/honeybadger/backtrace_spec.rb} +69 -71
  27. data/{test/unit/capistrano_test.rb → spec/honeybadger/capistrano_spec.rb} +8 -9
  28. data/{test/unit/configuration_test.rb → spec/honeybadger/configuration_spec.rb} +85 -59
  29. data/spec/honeybadger/logger_spec.rb +65 -0
  30. data/spec/honeybadger/monitor/worker_spec.rb +189 -0
  31. data/{test/unit/notice_test.rb → spec/honeybadger/notice_spec.rb} +169 -185
  32. data/spec/honeybadger/notifier_spec.rb +252 -0
  33. data/spec/honeybadger/rack_spec.rb +84 -0
  34. data/{test/unit/rails/action_controller_catcher_test.rb → spec/honeybadger/rails/action_controller_spec.rb} +65 -57
  35. data/{test/unit/rails_test.rb → spec/honeybadger/rails_spec.rb} +8 -8
  36. data/spec/honeybadger/sender_spec.rb +249 -0
  37. data/spec/honeybadger_tasks_spec.rb +165 -0
  38. data/spec/spec_helper.rb +18 -0
  39. data/spec/support/array_including.rb +31 -0
  40. data/spec/support/backtraced_exception.rb +9 -0
  41. data/spec/support/collected_sender.rb +12 -0
  42. data/spec/support/defines_constants.rb +18 -0
  43. data/{test/test_helper.rb → spec/support/helpers.rb} +8 -61
  44. metadata +93 -45
  45. data/test/unit/honeybadger_tasks_test.rb +0 -167
  46. data/test/unit/logger_test.rb +0 -74
  47. data/test/unit/notifier_test.rb +0 -265
  48. data/test/unit/rack_test.rb +0 -88
  49. data/test/unit/sender_test.rb +0 -290
@@ -0,0 +1,18 @@
1
+ require 'rspec'
2
+ require 'honeybadger'
3
+
4
+ # Require files in spec/support/ and its subdirectories.
5
+ Dir[File.expand_path('../../spec/support/**/*.rb', __FILE__)].each {|f| require f}
6
+
7
+ RSpec.configure do |c|
8
+ c.mock_with :rspec
9
+ c.color_enabled = true
10
+ c.tty = true
11
+
12
+ c.treat_symbols_as_metadata_keys_with_true_values = true
13
+ c.filter_run :focus => true
14
+ c.run_all_when_everything_filtered = true
15
+
16
+ c.include Helpers
17
+ c.after(:each) { Honeybadger.context.clear! }
18
+ end
@@ -0,0 +1,31 @@
1
+ module RSpec
2
+ module Mocks
3
+ module ArgumentMatchers
4
+ class ArrayIncludingMatcher
5
+ def initialize(expected)
6
+ @expected = expected
7
+ end
8
+
9
+ def ==(actual)
10
+ @expected.all? do |value|
11
+ if Regexp === value
12
+ actual.any? {|v| value =~ v }
13
+ else
14
+ actual.include?(value)
15
+ end
16
+ end
17
+ rescue NoMethodError
18
+ false
19
+ end
20
+
21
+ def description
22
+ "array_including(#{@expected.inspect})"
23
+ end
24
+ end
25
+
26
+ def array_including(*args)
27
+ ArrayIncludingMatcher.new(args.flatten)
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,9 @@
1
+ class BacktracedException < Exception
2
+ attr_accessor :backtrace
3
+ def initialize(opts)
4
+ @backtrace = opts[:backtrace]
5
+ end
6
+ def set_backtrace(bt)
7
+ @backtrace = bt
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ class CollectingSender
2
+ attr_reader :collected
3
+
4
+ def initialize
5
+ @collected = []
6
+ end
7
+
8
+ def send_to_honeybadger(notice)
9
+ data = notice.respond_to?(:to_json) ? notice.to_json : notice
10
+ @collected << data
11
+ end
12
+ end
@@ -0,0 +1,18 @@
1
+ module DefinesConstants
2
+ def self.included(base)
3
+ base.before(:each) do
4
+ @defined_constants = []
5
+ end
6
+
7
+ base.after(:each) do
8
+ @defined_constants.each do |constant|
9
+ Object.__send__(:remove_const, constant)
10
+ end
11
+ end
12
+ end
13
+
14
+ def define_constant(name, value)
15
+ Object.const_set(name, value)
16
+ @defined_constants << name
17
+ end
18
+ end
@@ -1,63 +1,10 @@
1
- require 'test/unit'
2
-
3
- require 'mocha'
4
- require 'shoulda'
5
- require 'bourne'
6
- require 'rack'
7
-
8
- require 'honeybadger'
9
-
10
- class BacktracedException < Exception
11
- attr_accessor :backtrace
12
- def initialize(opts)
13
- @backtrace = opts[:backtrace]
14
- end
15
- def set_backtrace(bt)
16
- @backtrace = bt
17
- end
18
- end
19
-
20
- module DefinesConstants
21
- def setup
22
- @defined_constants = []
23
- end
24
-
25
- def teardown
26
- @defined_constants.each do |constant|
27
- Object.__send__(:remove_const, constant)
28
- end
29
- end
30
-
31
- def define_constant(name, value)
32
- Object.const_set(name, value)
33
- @defined_constants << name
34
- end
35
- end
36
-
37
- class CollectingSender
38
- attr_reader :collected
39
-
40
- def initialize
41
- @collected = []
42
- end
43
-
44
- def send_to_honeybadger(notice)
45
- data = notice.respond_to?(:to_json) ? notice.to_json : notice
46
- @collected << data
47
- end
48
- end
49
-
50
- class Test::Unit::TestCase
51
- def teardown
52
- Honeybadger.context.clear!
53
- end
54
-
1
+ module Helpers
55
2
  def assert_no_difference(expression, message = nil, &block)
56
3
  assert_difference expression, 0, message, &block
57
4
  end
58
5
 
59
6
  def stub_sender
60
- stub('sender', :send_to_honeybadger => nil)
7
+ double('sender', :send_to_honeybadger => nil)
61
8
  end
62
9
 
63
10
  def stub_sender!
@@ -66,13 +13,13 @@ class Test::Unit::TestCase
66
13
 
67
14
  def stub_notice
68
15
  Honeybadger::Notice.new({}).tap do |notice|
69
- notice.stubs(:ignored? => false, :to_json => '{"foo":"bar"}')
16
+ notice.stub(:ignored? => false, :to_json => '{"foo":"bar"}')
70
17
  end
71
18
  end
72
19
 
73
20
  def stub_notice!
74
21
  stub_notice.tap do |notice|
75
- Honeybadger::Notice.stubs(:new => notice)
22
+ Honeybadger::Notice.stub(:new => notice)
76
23
  end
77
24
  end
78
25
 
@@ -112,10 +59,10 @@ class Test::Unit::TestCase
112
59
  end
113
60
 
114
61
  def assert_array_starts_with(expected, actual)
115
- assert_respond_to actual, :to_ary
62
+ expect(actual).to respond_to :to_ary
116
63
  array = actual.to_ary.reverse
117
64
  expected.reverse.each_with_index do |value, i|
118
- assert_equal value, array[i]
65
+ expect(array[i]).to eq value
119
66
  end
120
67
  end
121
68
 
@@ -132,10 +79,10 @@ class Test::Unit::TestCase
132
79
  end
133
80
 
134
81
  def assert_caught_and_sent
135
- assert !Honeybadger.sender.collected.empty?
82
+ expect(Honeybadger.sender.collected).not_to be_empty
136
83
  end
137
84
 
138
85
  def assert_caught_and_not_sent
139
- assert Honeybadger.sender.collected.empty?
86
+ expect(Honeybadger.sender.collected).to be_empty
140
87
  end
141
88
  end
metadata CHANGED
@@ -1,16 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
5
- prerelease:
4
+ version: 1.9.0.beta1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Joshua Wood
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-01 00:00:00.000000000 Z
12
+ date: 2013-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: faraday
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: json
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +66,7 @@ dependencies:
50
66
  requirements:
51
67
  - - ~>
52
68
  - !ruby/object:Gem::Version
53
- version: 2.12.0
69
+ version: 2.14.0
54
70
  type: :development
55
71
  prerelease: false
56
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +74,7 @@ dependencies:
58
74
  requirements:
59
75
  - - ~>
60
76
  - !ruby/object:Gem::Version
61
- version: 2.12.0
77
+ version: 2.14.0
62
78
  - !ruby/object:Gem::Dependency
63
79
  name: fakeweb
64
80
  requirement: !ruby/object:Gem::Requirement
@@ -92,13 +108,13 @@ dependencies:
92
108
  - !ruby/object:Gem::Version
93
109
  version: 1.3.0
94
110
  - !ruby/object:Gem::Dependency
95
- name: bourne
111
+ name: capistrano
96
112
  requirement: !ruby/object:Gem::Requirement
97
113
  none: false
98
114
  requirements:
99
115
  - - ! '>='
100
116
  - !ruby/object:Gem::Version
101
- version: '1.0'
117
+ version: '0'
102
118
  type: :development
103
119
  prerelease: false
104
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,25 +122,25 @@ dependencies:
106
122
  requirements:
107
123
  - - ! '>='
108
124
  - !ruby/object:Gem::Version
109
- version: '1.0'
125
+ version: '0'
110
126
  - !ruby/object:Gem::Dependency
111
- name: shoulda
127
+ name: rake
112
128
  requirement: !ruby/object:Gem::Requirement
113
129
  none: false
114
130
  requirements:
115
- - - ~>
131
+ - - ! '>='
116
132
  - !ruby/object:Gem::Version
117
- version: 2.11.3
133
+ version: '0'
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
121
137
  none: false
122
138
  requirements:
123
- - - ~>
139
+ - - ! '>='
124
140
  - !ruby/object:Gem::Version
125
- version: 2.11.3
141
+ version: '0'
126
142
  - !ruby/object:Gem::Dependency
127
- name: capistrano
143
+ name: sinatra
128
144
  requirement: !ruby/object:Gem::Requirement
129
145
  none: false
130
146
  requirements:
@@ -140,7 +156,7 @@ dependencies:
140
156
  - !ruby/object:Gem::Version
141
157
  version: '0'
142
158
  - !ruby/object:Gem::Dependency
143
- name: rake
159
+ name: aruba
144
160
  requirement: !ruby/object:Gem::Requirement
145
161
  none: false
146
162
  requirements:
@@ -156,7 +172,7 @@ dependencies:
156
172
  - !ruby/object:Gem::Version
157
173
  version: '0'
158
174
  - !ruby/object:Gem::Dependency
159
- name: sinatra
175
+ name: appraisal
160
176
  requirement: !ruby/object:Gem::Requirement
161
177
  none: false
162
178
  requirements:
@@ -172,7 +188,7 @@ dependencies:
172
188
  - !ruby/object:Gem::Version
173
189
  version: '0'
174
190
  - !ruby/object:Gem::Dependency
175
- name: aruba
191
+ name: guard
176
192
  requirement: !ruby/object:Gem::Requirement
177
193
  none: false
178
194
  requirements:
@@ -188,7 +204,39 @@ dependencies:
188
204
  - !ruby/object:Gem::Version
189
205
  version: '0'
190
206
  - !ruby/object:Gem::Dependency
191
- name: appraisal
207
+ name: guard-rspec
208
+ requirement: !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ! '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ - !ruby/object:Gem::Dependency
223
+ name: fuubar
224
+ requirement: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ! '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
234
+ requirements:
235
+ - - ! '>='
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: growl
192
240
  requirement: !ruby/object:Gem::Requirement
193
241
  none: false
194
242
  requirements:
@@ -257,9 +305,14 @@ files:
257
305
  - generators/honeybadger/templates/initializer.rb
258
306
  - honeybadger.gemspec
259
307
  - lib/honeybadger.rb
308
+ - lib/honeybadger/array.rb
260
309
  - lib/honeybadger/backtrace.rb
261
310
  - lib/honeybadger/capistrano.rb
262
311
  - lib/honeybadger/configuration.rb
312
+ - lib/honeybadger/monitor.rb
313
+ - lib/honeybadger/monitor/railtie.rb
314
+ - lib/honeybadger/monitor/sender.rb
315
+ - lib/honeybadger/monitor/worker.rb
263
316
  - lib/honeybadger/notice.rb
264
317
  - lib/honeybadger/rack.rb
265
318
  - lib/honeybadger/rails.rb
@@ -279,18 +332,24 @@ files:
279
332
  - resources/README.md
280
333
  - resources/ca-bundle.crt
281
334
  - script/integration_test.rb
282
- - test/test_helper.rb
283
- - test/unit/backtrace_test.rb
284
- - test/unit/capistrano_test.rb
285
- - test/unit/configuration_test.rb
286
- - test/unit/honeybadger_tasks_test.rb
287
- - test/unit/logger_test.rb
288
- - test/unit/notice_test.rb
289
- - test/unit/notifier_test.rb
290
- - test/unit/rack_test.rb
291
- - test/unit/rails/action_controller_catcher_test.rb
292
- - test/unit/rails_test.rb
293
- - test/unit/sender_test.rb
335
+ - spec/honeybadger/backtrace_spec.rb
336
+ - spec/honeybadger/capistrano_spec.rb
337
+ - spec/honeybadger/configuration_spec.rb
338
+ - spec/honeybadger/logger_spec.rb
339
+ - spec/honeybadger/monitor/worker_spec.rb
340
+ - spec/honeybadger/notice_spec.rb
341
+ - spec/honeybadger/notifier_spec.rb
342
+ - spec/honeybadger/rack_spec.rb
343
+ - spec/honeybadger/rails/action_controller_spec.rb
344
+ - spec/honeybadger/rails_spec.rb
345
+ - spec/honeybadger/sender_spec.rb
346
+ - spec/honeybadger_tasks_spec.rb
347
+ - spec/spec_helper.rb
348
+ - spec/support/array_including.rb
349
+ - spec/support/backtraced_exception.rb
350
+ - spec/support/collected_sender.rb
351
+ - spec/support/defines_constants.rb
352
+ - spec/support/helpers.rb
294
353
  homepage: http://www.honeybadger.io
295
354
  licenses: []
296
355
  post_install_message:
@@ -307,28 +366,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
366
  version: '0'
308
367
  segments:
309
368
  - 0
310
- hash: -148961538032619748
369
+ hash: 324144586137984289
311
370
  required_rubygems_version: !ruby/object:Gem::Requirement
312
371
  none: false
313
372
  requirements:
314
- - - ! '>='
373
+ - - ! '>'
315
374
  - !ruby/object:Gem::Version
316
- version: '0'
375
+ version: 1.3.1
317
376
  requirements: []
318
377
  rubyforge_project:
319
378
  rubygems_version: 1.8.23
320
379
  signing_key:
321
380
  specification_version: 2
322
381
  summary: Error reports you can be happy about.
323
- test_files:
324
- - test/unit/backtrace_test.rb
325
- - test/unit/capistrano_test.rb
326
- - test/unit/configuration_test.rb
327
- - test/unit/honeybadger_tasks_test.rb
328
- - test/unit/logger_test.rb
329
- - test/unit/notice_test.rb
330
- - test/unit/notifier_test.rb
331
- - test/unit/rack_test.rb
332
- - test/unit/rails/action_controller_catcher_test.rb
333
- - test/unit/rails_test.rb
334
- - test/unit/sender_test.rb
382
+ test_files: []