airbrake-statsd 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,21 +1,15 @@
1
1
  module Airbrake
2
2
  class << self
3
3
 
4
- def notify_with_statds(*args)
5
- Airbrake::Statsd.increment
6
- notify_without_statsd(*args)
7
- end
8
-
9
- alias :notify_without_statsd :notify
10
- alias :notify :notify_with_statds
4
+ private
11
5
 
12
- def notify_or_ignore_with_statsd(*args)
6
+ def send_notice_with_statsd(*args)
13
7
  Airbrake::Statsd.increment
14
- notify_or_ignore_without_statsd(*args)
8
+ send_notice_without_statsd(*args)
15
9
  end
16
10
 
17
- alias :notify_or_ignore_without_statsd :notify_or_ignore
18
- alias :notify_or_ignore :notify_or_ignore_with_statsd
11
+ alias :send_notice_without_statsd :send_notice
12
+ alias :send_notice :send_notice_with_statsd
19
13
 
20
14
  end
21
15
  end
@@ -1,5 +1,5 @@
1
1
  module Airbrake
2
2
  module Statsd
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -4,58 +4,33 @@ describe Airbrake do
4
4
 
5
5
  subject { Airbrake }
6
6
 
7
- it '#notify is an alias to #notify_with_statsd' do
8
- subject.method(:notify).should == subject.method(:notify_with_statds)
9
- end
10
-
11
- it '#notify_or_ignore is an alias to #notify_or_ignore_with_statsd' do
12
- subject.method(:notify_or_ignore).
13
- should == subject.method(:notify_or_ignore_with_statsd)
14
- end
15
-
16
- describe '#notify_without_statsd' do
17
- it 'does not call Airbrake::Statsd.increment' do
18
- Airbrake.stub(:send_notice).and_return(nil)
19
-
20
- Airbrake.should_receive(:build_notice_for).with('oops', {})
21
- Airbrake::Statsd.should_not_receive(:increment)
7
+ let(:notice) { mock('Notice', :to_xml => '') }
8
+ let(:configuration) { mock('Configuration', :public? => true) }
22
9
 
23
- Airbrake.notify_without_statsd('oops', {})
24
- end
10
+ let(:sender) do
11
+ sender = mock('Sender')
12
+ sender.stub(:send_to_airbrake)
13
+ sender
25
14
  end
26
15
 
27
- describe '#notify' do
28
- it 'calls Airbrake::Statsd.increment' do
29
- Airbrake.stub(:send_notice).and_return(nil)
30
-
31
- Airbrake.should_receive(:build_notice_for).with('oops', {})
32
- Airbrake::Statsd.should_receive(:increment)
33
-
34
- Airbrake.notify('oops', {})
16
+ describe '#send_notice_without_statsd' do
17
+ before do
18
+ Airbrake.stub(:configuration).and_return(configuration)
19
+ Airbrake.stub(:sender).and_return(sender)
35
20
  end
36
- end
37
21
 
38
- describe '#notify_or_ignore_without_statsd' do
39
22
  it 'does not call Airbrake::Statsd.increment' do
40
- Airbrake.stub(:send_notice).and_return(nil)
41
-
42
- Airbrake.should_receive(:build_notice_for).with('oops', {}).
43
- and_return(mock('Notice', :ignore? => false))
44
23
  Airbrake::Statsd.should_not_receive(:increment)
45
-
46
- Airbrake.notify_or_ignore_without_statsd('oops', {})
24
+ Airbrake.send(:send_notice_without_statsd, notice)
47
25
  end
48
26
  end
49
27
 
50
- describe '#notify_or_ignore' do
28
+ describe '#send_notice' do
51
29
  it 'calls Airbrake::Statsd.increment' do
52
- Airbrake.stub(:send_notice).and_return(nil)
53
-
54
- Airbrake.should_receive(:build_notice_for).with('oops', {}).
55
- and_return(mock('Notice', :ignore? => false))
56
30
  Airbrake::Statsd.should_receive(:increment)
31
+ Airbrake.should_receive(:send_notice_without_statsd)
57
32
 
58
- Airbrake.notify_or_ignore('oops', {})
33
+ Airbrake.send(:send_notice, notice)
59
34
  end
60
35
  end
61
36
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake-statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70244425362220 !ruby/object:Gem::Requirement
16
+ requirement: &70351921134160 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70244425362220
24
+ version_requirements: *70351921134160
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70244425360740 !ruby/object:Gem::Requirement
27
+ requirement: &70351921132700 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70244425360740
35
+ version_requirements: *70351921132700
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simplecov
38
- requirement: &70244425359980 !ruby/object:Gem::Requirement
38
+ requirement: &70351921132100 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70244425359980
46
+ version_requirements: *70351921132100
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: airbrake
49
- requirement: &70244425359340 !ruby/object:Gem::Requirement
49
+ requirement: &70351921130780 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70244425359340
57
+ version_requirements: *70351921130780
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: statsd-ruby
60
- requirement: &70244425358600 !ruby/object:Gem::Requirement
60
+ requirement: &70351921130220 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70244425358600
68
+ version_requirements: *70351921130220
69
69
  description: Increment an exception counter in StatsD whenever the Airbrake gem reports
70
70
  and exception.
71
71
  email:
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: -2772850285584878905
105
+ hash: 3298473845107013173
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  segments:
113
113
  - 0
114
- hash: -2772850285584878905
114
+ hash: 3298473845107013173
115
115
  requirements: []
116
116
  rubyforge_project:
117
117
  rubygems_version: 1.8.11