Skip to content

Commit

Permalink
ensure that dynamically generated method names don't affect event gro…
Browse files Browse the repository at this point in the history
…up identifier
  • Loading branch information
flyingmachine committed Nov 10, 2011
1 parent b486375 commit 06748d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
whoops_rails_logger (0.1.6)
whoops_rails_logger (0.1.8)
rails (~> 3)
whoops_logger (= 0.1.4)

Expand Down Expand Up @@ -57,7 +57,7 @@ GEM
fakeweb (1.3.0)
ffi (1.0.9)
i18n (0.5.0)
json (1.5.3)
json (1.6.1)
json_pure (1.5.1)
linecache (0.43)
mail (2.2.19)
Expand All @@ -67,7 +67,7 @@ GEM
treetop (~> 1.4.8)
mime-types (1.16)
nokogiri (1.4.4)
polyglot (0.3.1)
polyglot (0.3.3)
rack (1.2.3)
rack-mount (0.6.14)
rack (>= 1.0.0)
Expand Down Expand Up @@ -113,7 +113,8 @@ GEM
rubyzip
sqlite3 (1.3.3)
thor (0.14.6)
treetop (1.4.9)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.27)
whoops_logger (0.1.4)
Expand All @@ -127,10 +128,8 @@ PLATFORMS
DEPENDENCIES
capybara (>= 0.4.0)
fakeweb
rails (~> 3)
rake (= 0.8.7)
rspec-rails
ruby-debug
sqlite3
whoops_logger (= 0.1.4)
whoops_rails_logger!
16 changes: 16 additions & 0 deletions spec/whoops_rails_logger/exception_strategy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,21 @@
mc.message.details[:session].should == rack_env["rack.session"]
mc.message.details[:env].should == ENV.to_hash
end

it "creates the same event group identifier when backtraces have the same sequence of file/line numbers, ignoring method name" do
exception.stub!(:backtrace).and_return([
"$GEM_HOME/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:386:in `_run123_process_action_callbacks'"
])
mc1 = WhoopsLogger::MessageCreator.new(rails_exception_strategy, raw_data)
mc1.create!

exception.stub!(:backtrace).and_return([
"$GEM_HOME/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:386:in `_run456_process_action_callbacks'"
])
mc2 = WhoopsLogger::MessageCreator.new(rails_exception_strategy, raw_data)
mc2.create!

mc1.message.event_group_identifier.should == mc2.message.event_group_identifier
end
end
end

0 comments on commit 06748d4

Please sign in to comment.