Sha256: 0a69d961cd51cfd3c63235401dfca95963b4cfc14a7f0cac329f8dcb42e1c203

Contents?: true

Size: 845 Bytes

Versions: 2

Compression:

Stored size: 845 Bytes

Contents

require 'abstract_unit'
require 'rails/backtrace_cleaner'

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" ]
    @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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activejob-lock-0.0.2 rails/railties/test/backtrace_cleaner_test.rb
activejob-lock-0.0.1 rails/railties/test/backtrace_cleaner_test.rb