Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/raven/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def capture_type(obj, options = {})
end
end

alias capture_message capture_type
alias capture_exception capture_type

def last_event_id
Thread.current["sentry_#{object_id}_last_event_id".to_sym]
end
Expand Down
14 changes: 14 additions & 0 deletions spec/raven/instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
subject.capture_type(message, options)
end

it 'has an alias' do
expect(Raven::Event).to receive(:from_message).with(message, options)
expect(subject).to receive(:send_event).with(event)

subject.capture_message(message, options)
end

it 'yields the event to a passed block' do
expect { |b| subject.capture_type(message, options, &b) }.to yield_with_args(event)
end
Expand Down Expand Up @@ -80,6 +87,13 @@
subject.capture_type(exception, options)
end

it 'has an alias' do
expect(Raven::Event).to receive(:from_exception).with(exception, options)
expect(subject).to receive(:send_event).with(event)

subject.capture_exception(exception, options)
end

it 'yields the event to a passed block' do
expect { |b| subject.capture_type(exception, options, &b) }.to yield_with_args(event)
end
Expand Down