Permalink
Browse files

cleaner backtrace cleansing

  • Loading branch information...
dchelimsky committed Mar 29, 2011
1 parent dff001d commit 0ff66c4bc82efbe3f38c8c38aec5b0e4fc2c3c2b
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/rspec/core/backward_compatibility.rb
@@ -20,7 +20,10 @@ def const_missing(name)
begin
super
rescue Exception => e
- while e.backtrace.first =~ /lib\/rspec\/(.*)\/backward_compatibility\.rb/
+ while e.backtrace.first !~ Regexp.compile(__FILE__)
+ e.backtrace.shift
+ end
+ while e.backtrace.first =~ Regexp.compile(__FILE__)
e.backtrace.shift
end
raise e
@@ -48,7 +51,10 @@ def self.const_missing(name)
begin
super
rescue Exception => e
- while e.backtrace.first =~ /(lib\/rspec\/(.*)\/backward_compatibility\.rb|lib\/rake\.rb)/
+ while e.backtrace.first !~ Regexp.compile(__FILE__)
+ e.backtrace.shift
+ end
+ while e.backtrace.first =~ Regexp.compile(__FILE__)
e.backtrace.shift
end
raise e

0 comments on commit 0ff66c4

Please sign in to comment.