diff --git a/lib/raven/event.rb b/lib/raven/event.rb index 771fafba9..34bfdc850 100644 --- a/lib/raven/event.rb +++ b/lib/raven/event.rb @@ -52,7 +52,8 @@ def initialize(options = {}, &block) @extra = options[:extra] || {} @extra.merge!(context.extra) - @tags = @configuration.tags + @tags = {} + @tags.merge!(@configuration.tags) @tags.merge!(options[:tags] || {}) @tags.merge!(context.tags) diff --git a/spec/raven/event_spec.rb b/spec/raven/event_spec.rb index c32183d1c..4b865f22a 100644 --- a/spec/raven/event_spec.rb +++ b/spec/raven/event_spec.rb @@ -200,6 +200,31 @@ end end + context 'configuration tags unspecified' do + it 'should not persist tags between unrelated events' do + config = Raven::Configuration.new + + Raven::Event.new( + :level => 'warning', + :logger => 'foo', + :tags => { + 'foo' => 'bar' + }, + :server_name => 'foo.local', + :configuration => config + ) + + hash = Raven::Event.new( + :level => 'warning', + :logger => 'foo', + :server_name => 'foo.local', + :configuration => config + ).to_hash + + expect(hash['tags']).to eq({}) + end + end + describe '.initialize' do it 'should not touch the env object for an ignored environment' do Raven.configure(true) do |config|