err 0.0.2 → 0.0.3

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: ef940c8996ddb87924dfe348cf1699ac40037e56
4
- data.tar.gz: 057702d3d026a7ba47ffb2f8395501cf7d881a74
3
+ metadata.gz: 241d4018331027122302c309c271b8472abd8b82
4
+ data.tar.gz: 3254241b5f12e6454c185e145047bb9401e1aa10
5
5
  SHA512:
6
- metadata.gz: 3a3e0821ad5c1db5773a837244e6bbc66a388a1ddd89a76150e9a4777606aa83c76f5cea7fef5516bfc257091e4990208c0b88218b70df80852b00472c123919
7
- data.tar.gz: 1ba9a8d2b79d707095be87ff82f245941e07010b4f34ea6ed97e2f9663a83f79d3bd8b0374396af0f537a68141bf814aa211bd706ade4d1882475921779d2ff3
6
+ metadata.gz: 2cfe8e1e4222af16560f22daffb8d0337879aba484a9210efac36556753e3d01dc32d92f356b554666489530a036304e14aebeae31b559a53d302021c187bfde
7
+ data.tar.gz: d357dedce1072a751803f045e02b605a7b21aa23c009b0a6fd630fcbdd56f2b4d125a21bbcf4bfe5080f87bf9ead9f2dd348ce1bb7c8bd5c9d8ea92085e25bd0
@@ -19,13 +19,11 @@ module Err
19
19
  end
20
20
 
21
21
  def notify(exception, params = {})
22
- opbeat.captureException(exception)
22
+ opbeat.captureException(exception, extra: params)
23
23
  end
24
24
 
25
25
  def message(msg, params = {})
26
- msg = msg.dup
27
- msg << " (#{params_string(params)})" if params.any?
28
- opbeat.captureMessage(msg)
26
+ opbeat.captureMessage(msg, extra: params)
29
27
  end
30
28
 
31
29
  private
@@ -1,3 +1,3 @@
1
1
  module Err
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -45,12 +45,24 @@ class OpbeatTest < Minitest::Test
45
45
  end
46
46
 
47
47
  def test_notify
48
- Opbeat.expects(:captureException).once
49
- Err::Opbeat.notify RuntimeError.new
48
+ exception = RuntimeError.new
49
+ Opbeat.expects(:captureException).with(exception, extra: {}).once
50
+ Err::Opbeat.notify exception
51
+ end
52
+
53
+ def test_notify_with_params
54
+ exception = RuntimeError.new
55
+ Opbeat.expects(:captureException).with(exception, extra: { id: 1, b: 2 }).once
56
+ Err::Opbeat.notify exception, id: 1, b: 2
50
57
  end
51
58
 
52
59
  def test_message
53
- Opbeat.expects(:captureMessage).once
60
+ Opbeat.expects(:captureMessage).with("This is a test", extra: {}).once
61
+ Err::Opbeat.message "This is a test"
62
+ end
63
+
64
+ def test_message_with_params
65
+ Opbeat.expects(:captureMessage).with("This is a test", extra: { one: "First", two: "Second" }).once
54
66
  Err::Opbeat.message "This is a test", one: "First", two: "Second"
55
67
  end
56
68
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: err
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lasse Bunk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler