Skip to content

Commit 169b5d9

Browse files
committed
Merge pull request #332 from ripta/rp/avoid-deprwarns
Use send_event when capturing an exception
2 parents 3820b3d + fc3a4c5 commit 169b5d9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/raven/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def configure
7878
#
7979
# @example
8080
# evt = Raven::Event.new(:message => "An error")
81-
# Raven.send(evt)
81+
# Raven.send_event(evt)
8282
def send_event(event)
8383
client.send_event(event)
8484
end
@@ -119,7 +119,7 @@ def capture_type(obj, options = {})
119119
if configuration.async?
120120
configuration.async.call(evt)
121121
else
122-
send(evt)
122+
send_event(evt)
123123
end
124124
end
125125
end

spec/raven/integration_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
config.http_adapter = [:test, stubs]
5656
end
5757

58-
expect(Raven.logger).to receive(:warn).exactly(2).times
58+
expect(Raven.logger).to receive(:warn).once
5959
expect { Raven.capture_exception(build_exception) }.not_to raise_error
6060

6161
stubs.verify_stubbed_calls

spec/raven/raven_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let(:options) { double("options") }
66

77
before do
8-
allow(Raven).to receive(:send)
8+
allow(Raven).to receive(:send_event)
99
allow(Raven::Event).to receive(:from_message) { event }
1010
allow(Raven::Event).to receive(:from_exception) { event }
1111
end
@@ -15,7 +15,7 @@
1515

1616
it 'sends the result of Event.capture_message' do
1717
expect(Raven::Event).to receive(:from_message).with(message, options)
18-
expect(Raven).to receive(:send).with(event)
18+
expect(Raven).to receive(:send_event).with(event)
1919

2020
Raven.capture_message(message, options)
2121
end
@@ -30,7 +30,7 @@
3030

3131
it 'sends the result of Event.capture_message' do
3232
expect(Raven::Event).to receive(:from_message).with(message, options)
33-
expect(Raven).not_to receive(:send).with(event)
33+
expect(Raven).not_to receive(:send_event).with(event)
3434

3535
prior_async = Raven.configuration.async
3636
Raven.configuration.async = lambda { :ok }
@@ -45,7 +45,7 @@
4545

4646
it 'sends the result of Event.capture_exception' do
4747
expect(Raven::Event).to receive(:from_exception).with(exception, options)
48-
expect(Raven).to receive(:send).with(event)
48+
expect(Raven).to receive(:send_event).with(event)
4949

5050
Raven.capture_exception(exception, options)
5151
end
@@ -60,7 +60,7 @@
6060

6161
it 'sends the result of Event.capture_exception' do
6262
expect(Raven::Event).to receive(:from_exception).with(exception, options)
63-
expect(Raven).not_to receive(:send).with(event)
63+
expect(Raven).not_to receive(:send_event).with(event)
6464

6565
prior_async = Raven.configuration.async
6666
Raven.configuration.async = lambda { :ok }
@@ -74,7 +74,7 @@
7474
let(:exception) { build_exception }
7575

7676
it 'sends the result of Event.capture_exception according to the result of should_capture' do
77-
expect(Raven).not_to receive(:send).with(event)
77+
expect(Raven).not_to receive(:send_event).with(event)
7878

7979
prior_should_capture = Raven.configuration.should_capture
8080
Raven.configuration.should_capture = Proc.new { false }

0 commit comments

Comments
 (0)