Add gem filter for default gem path since it maybe different than the set of gem paths

This commit is contained in:
Joshua Peek 2009-09-26 11:04:08 -05:00
parent 5eeed9f00a
commit 79a4d505fa
2 changed files with 3 additions and 3 deletions

@ -32,7 +32,7 @@ def initialize
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

@ -14,13 +14,13 @@ def setup
@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')