diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-26 11:04:08 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-26 11:04:08 -0500 |
commit | 79a4d505fa8bd83189296be60cf62601e6783597 (patch) | |
tree | 5cf578925d6c5a763e566f0feb5693a8ee6210d7 /railties | |
parent | 5eeed9f00a3bd57134cfa0e6792cd8767619c132 (diff) | |
download | rails-79a4d505fa8bd83189296be60cf62601e6783597.tar.gz rails-79a4d505fa8bd83189296be60cf62601e6783597.tar.bz2 rails-79a4d505fa8bd83189296be60cf62601e6783597.zip |
Add gem filter for default gem path since it maybe different than the set of gem paths
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/backtrace_cleaner.rb | 2 | ||||
-rw-r--r-- | railties/test/backtrace_cleaner_test.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails/backtrace_cleaner.rb b/railties/lib/rails/backtrace_cleaner.rb index 1605429e8b..9ff8367807 100644 --- a/railties/lib/rails/backtrace_cleaner.rb +++ b/railties/lib/rails/backtrace_cleaner.rb @@ -32,7 +32,7 @@ module Rails private def add_gem_filters - Gem.path.each do |path| + (Gem.path + [Gem.default_dir]).uniq.each do |path| # http://gist.github.com/30430 add_filter { |line| line.sub(/(#{path})\/gems\/([a-z]+)-([0-9.]+)\/(.*)/, '\2 (\3) \4')} end diff --git a/railties/test/backtrace_cleaner_test.rb b/railties/test/backtrace_cleaner_test.rb index 670fa99459..c3e4f970fe 100644 --- a/railties/test/backtrace_cleaner_test.rb +++ b/railties/test/backtrace_cleaner_test.rb @@ -14,13 +14,13 @@ if defined? Test::Unit::Util::BacktraceFilter @test = TestWithBacktrace.new @backtrace = [ './test/rails/benchmark_test.rb', './test/rails/dependencies.rb', '/opt/local/lib/ruby/kernel.rb' ] end - + test "test with backtrace should use the rails backtrace cleaner to clean" do Rails.stubs(:backtrace_cleaner).returns(stub(:clean)) Rails.backtrace_cleaner.expects(:clean).with(@backtrace, nil) @test.filter_backtrace(@backtrace) end - + test "filter backtrace should have the same arity as Test::Unit::Util::BacktraceFilter" do assert_nothing_raised do @test.filter_backtrace(@backtrace, '/opt/local/lib') |