minitest_rollbar 0.2.7 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44abac817f580ca69d886636937674193b0a51c8
4
- data.tar.gz: 40971faf5bf6901bda02f13fd2fffabed03135ac
3
+ metadata.gz: 1296b363cca31bcff33287bb482f21ea91824032
4
+ data.tar.gz: 6a95b051939d589f276691a77b954e2b1f17ac9d
5
5
  SHA512:
6
- metadata.gz: 87a0b0fad0d6f4e15025513e0ca4303e5f81792a1dc6f94b87d3c63ed1fc89141ec13386c2f44307631bd91b46a52e2eda3d89e7732cb28eae0f9b47ef60c0b4
7
- data.tar.gz: 577011db42fb2c35142d08d9ccc45cb6b2bcea0ac8436caa444dfb39be1dfdc73bcdad1abc8e85d66c98c6efdb406f8d2c4eeeaf3656a615d7c13bdc8757dc6b
6
+ metadata.gz: a2b562071716bd38167b7d2c88179c39307fffdd2fefcdd9379c398a36f1dc6a0cfff1c0493b5c3bf5705fca19acf41909afdd1c4048bbe28b5f45ce9de23a99
7
+ data.tar.gz: e61c735f88281c9ed78c5e846380b332f8d760eb7318c38b49cee1d0fe8d47ac86d9ef84e15dce31625f06f8baf7b11fdba9ec6ab556f65183c627f4fbf80976
data/README.md CHANGED
@@ -26,10 +26,10 @@ Require necessary files on test_helper:
26
26
 
27
27
  require 'minitest_rollbar'
28
28
 
29
- Set up authentication token by:
30
-
31
- MinitestRollbar.access_token = {YOUR_TOKEN}
29
+ Get a reporter with access_token and ssl policy using:
32
30
 
31
+ @reporter = MinitestRollbar::RollbarReporter.new(rollbar_config: {verify_ssl_peer: false, access_token: 'whatever'})
32
+
33
33
  By default we try to group occurrence by string returned by exception.inspect (Concatenate exception class name and message). We generate a fingerprint for that. To use rollbar's [default](https://rollbar.com/docs/grouping-algorithm/) default grouping algorithm, do
34
34
 
35
35
  MinitestRollbar.use_default_grouping = true
@@ -2,14 +2,14 @@ require 'rollbar'
2
2
  require 'minitest/reporters'
3
3
  module MinitestRollbar
4
4
  class << self
5
- attr_accessor :access_token
6
5
  attr_accessor :use_default_grouping
7
- attr_accessor :enable_verify_ssl_peer
8
6
  end
9
7
 
10
8
  class RollbarReporter < Minitest::Reporters::BaseReporter
11
9
  def initialize(options = {})
12
- super
10
+ rollbar_config = options.delete(:rollbar_config) || {}
11
+ super(options)
12
+
13
13
  @sequential_exception_count = 0
14
14
  # Inspect will return ExceptionType + Message.
15
15
  # E.g #<Selenium::WebDriver::Error::NoSuchWindowError: Window not found. The browser window may have been closed.>
@@ -17,16 +17,13 @@ module MinitestRollbar
17
17
  @previous_exception_inspect_result = nil
18
18
  @previous_exception = nil
19
19
 
20
- raise 'Must set rollbar access token' if MinitestRollbar.access_token.nil?
21
20
  Rollbar.configure do |config|
22
- config.access_token = MinitestRollbar.access_token
23
- config.verify_ssl_peer = false
24
-
25
- unless MinitestRollbar.enable_verify_ssl_peer.nil?
26
- config.verify_ssl_peer = MinitestRollbar.enable_verify_ssl_peer
21
+ rollbar_config.each do |key, value|
22
+ config.send "#{key}=", value
27
23
  end
28
-
29
24
  end
25
+
26
+ raise 'Must set rollbar access token' if Rollbar.configuration.access_token.nil?
30
27
  end
31
28
 
32
29
  def record(result)
@@ -1,3 +1,3 @@
1
1
  module MinitestRollbar
2
- VERSION = '0.2.7'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest_rollbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuesong Wang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-18 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler