roqua-support 0.1.2.1 → 0.1.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5630dc4eb6452f316d41227ba3b233fd0ec4446b
4
- data.tar.gz: 3a33380768215e7f9cf6213511c512583af0946e
3
+ metadata.gz: 0ac53c450b17e874859934e55be62b8ddc7ae00d
4
+ data.tar.gz: 2f54b672a70529b33ee906ee88788c3f736e98ec
5
5
  SHA512:
6
- metadata.gz: 3d3a36dc54de7db6ed108e623d947ad13e91ed93f4a4300774254fdecd773b683290282046a3f90f8453924bb291d94d6ea65911b10970fa04a2f75e11ddb05f
7
- data.tar.gz: 54aa2724374a6f7ee746b5d254731007305540e9e405589ef8c57c1a598ee2820519f71a49ef0cbe87d2c6fee99dd6ac05ad69334e6499547b6269c84550e64c
6
+ metadata.gz: 144657fabc0578bd624c3e28a098da7c3f8623791c87cf1bb40dd5433bbb21e6179c663c201699bf9ef08f87a712363a54a522c1c7c3b765d567005fd2f4bdc6
7
+ data.tar.gz: 9f26d2f6fb732c0fc89f54619371d12e45804cff76099f1b708ebfccf63c373c9426a51e89e984197ac64e8eaa890354621583e1e1d46f5a1ee4ce9608fa5bef
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- roqua-support (0.1.2.1)
4
+ roqua-support (0.1.2.2)
5
5
  activesupport (>= 3.2, < 5.0)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module Support
3
- VERSION = "0.1.2.1"
3
+ VERSION = "0.1.2.2"
4
4
  end
5
5
  end
@@ -34,11 +34,13 @@ module Roqua
34
34
  # this functionality should be supported directly by Appsignal.send_exception.
35
35
  # Appsignal.send_exception(exception, parameters: parameters)
36
36
 
37
- transaction = Appsignal::Transaction.create(SecureRandom.uuid, ENV.to_hash)
38
- transaction.set_tags(parameters)
39
- transaction.add_exception(exception)
40
- transaction.complete!
41
- Appsignal.agent.send_queue
37
+ if Appsignal.active?
38
+ transaction = Appsignal::Transaction.create(SecureRandom.uuid, ENV.to_hash)
39
+ transaction.set_tags(parameters)
40
+ transaction.add_exception(exception)
41
+ transaction.complete!
42
+ Appsignal.agent.send_queue
43
+ end
42
44
  end
43
45
  end
44
46
  end
@@ -25,19 +25,30 @@ describe 'Error reporting' do
25
25
  end
26
26
 
27
27
  it 'sends notifications to airbrake' do
28
- stub_const("Airbrake", double("Airbrake"))
28
+ stub_const("Airbrake", double("Airbrake", is_ignored_exception?: false))
29
29
  Airbrake.should_receive(:notify_or_ignore).with(exception, parameters: {})
30
30
  Roqua::Support::Errors.report exception
31
31
  end
32
32
 
33
- it 'sends notifications to appsignal' do
34
- stub_const("Appsignal", double("Appsignal"))
35
- Appsignal.should_receive(:send_exception_with_tags).with(exception, parameters: {})
36
- Roqua::Support::Errors.report exception
33
+ context 'when Appsignal is loaded' do
34
+ let(:agent) { double("agent") }
35
+ let(:transaction) { double("transaction") }
36
+
37
+ it 'sends notifications to appsignal' do
38
+ stub_const("Appsignal", Module.new)
39
+ Appsignal.stub(is_ignored_exception?: false, agent: agent)
40
+ stub_const("Appsignal::Transaction", double("Transaction", create: transaction))
41
+
42
+ transaction.should_receive(:set_tags).with({})
43
+ transaction.should_receive(:add_exception).with(exception)
44
+ transaction.should_receive(:complete!)
45
+ agent.should_receive(:send_queue)
46
+ Roqua::Support::Errors.report exception
47
+ end
37
48
  end
38
49
 
39
50
  it 'supports default extra params' do
40
- Roqua::Support::Errors.extra_parameters = {organization: 'some_org'}
51
+ Roqua::Support::Errors.stub(extra_parameters: {organization: 'some_org'})
41
52
  Roqua.logger.should_receive(:error).with('roqua.exception',
42
53
  class_name: 'Exception',
43
54
  message: 'exception_message',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.1
4
+ version: 0.1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-04 00:00:00.000000000 Z
11
+ date: 2014-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport