1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Gem cont presence checking has been removed

This commit is contained in:
Roman V. Babenko 2012-05-02 13:56:13 +03:00
parent 07438f9ebb
commit e17cc4d493
2 changed files with 15 additions and 19 deletions

View file

@ -17,8 +17,6 @@ module Rails
private
def add_gem_filters
return unless defined?(Gem)
gems_paths = (Gem.path | [Gem.default_dir]).map { |p| Regexp.escape(p) }
return if gems_paths.empty?

View file

@ -1,26 +1,24 @@
require 'abstract_unit'
require 'rails/backtrace_cleaner'
if defined? Gem
class BacktraceCleanerVendorGemTest < ActiveSupport::TestCase
def setup
@cleaner = Rails::BacktraceCleaner.new
end
class BacktraceCleanerVendorGemTest < ActiveSupport::TestCase
def setup
@cleaner = Rails::BacktraceCleaner.new
end
test "should format installed gems correctly" do
@backtrace = [ "#{Gem.path[0]}/gems/nosuchgem-1.2.3/lib/foo.rb" ]
test "should format installed gems correctly" do
@backtrace = [ "#{Gem.path[0]}/gems/nosuchgem-1.2.3/lib/foo.rb" ]
@result = @cleaner.clean(@backtrace, :all)
assert_equal "nosuchgem (1.2.3) lib/foo.rb", @result[0]
end
test "should format installed gems not in Gem.default_dir correctly" do
@target_dir = Gem.path.detect { |p| p != Gem.default_dir }
# skip this test if default_dir is the only directory on Gem.path
if @target_dir
@backtrace = [ "#{@target_dir}/gems/nosuchgem-1.2.3/lib/foo.rb" ]
@result = @cleaner.clean(@backtrace, :all)
assert_equal "nosuchgem (1.2.3) lib/foo.rb", @result[0]
end
test "should format installed gems not in Gem.default_dir correctly" do
@target_dir = Gem.path.detect { |p| p != Gem.default_dir }
# skip this test if default_dir is the only directory on Gem.path
if @target_dir
@backtrace = [ "#{@target_dir}/gems/nosuchgem-1.2.3/lib/foo.rb" ]
@result = @cleaner.clean(@backtrace, :all)
assert_equal "nosuchgem (1.2.3) lib/foo.rb", @result[0]
end
end
end
end