Skip to content

Commit

Permalink
Add RemoveStacktrace processor
Browse files Browse the repository at this point in the history
+ move processor specs into subfolder
  • Loading branch information
nateberkopec committed Nov 9, 2014
1 parent fd7c307 commit 14d3fef
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/raven/processor/removestacktrace.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Raven
class Processor::RemoveStacktrace < Processor

def process(value)
value['exception'].delete('stacktrace') if value['exception']

value
end

end
end
File renamed without changes.
19 changes: 19 additions & 0 deletions spec/raven/processors/removestacktrace_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'spec_helper'
require 'raven/processor/removestacktrace'

describe Raven::Processor::RemoveStacktrace do
before do
@client = double("client")
@processor = Raven::Processor::RemoveStacktrace.new(@client)
end

it 'should remove stacktraces' do
data = Raven::Event.capture_exception(build_exception).to_hash

expect(data['exception']['stacktrace']).to_not eq(nil)
result = @processor.process(data)

expect(result['exception']['stacktrace']).to eq(nil)
end

end
File renamed without changes.
File renamed without changes.

0 comments on commit 14d3fef

Please sign in to comment.