Sha256: 26e06f9c35d4f9429d315fd91b01f5b3abcd5ec70b8db280014fed5f8f8d7dbf

Contents?: true

Size: 720 Bytes

Versions: 10

Compression:

Stored size: 720 Bytes

Contents

RSpec.describe ActiveRecord::SqlAnalyzer::BacktraceFilter do
  before do
    ActiveRecord::SqlAnalyzer.configure { |_c| }
  end

  it "filters non-app paths" do
    lines = ActiveRecord::SqlAnalyzer.config[:backtrace_filter_proc].call(
      [
        "foo/bar:1 in 'method'",
        "#{Gem.path.first}:4231 in 'method'",
        "foo/bar:2 in 'method'",
        "#{File.realpath(Gem.path.first)}:9531 in 'method'",
        "foo/bar:3 in 'method'",
        "(eval):1234 in 'method'",
        "foo/bar:4 in 'method'"
      ]
    )

    expect(lines).to eq(
      [
        "foo/bar:1 in 'method'",
        "foo/bar:2 in 'method'",
        "foo/bar:3 in 'method'",
        "foo/bar:4 in 'method'"
      ]
    )
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
active_record-sql_analyzer-0.3.0 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.2.3 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.2.2 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.2.1 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.2.0 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.1.0 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.0.8 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.0.7 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.0.6 spec/active_record/sql_analyzer/backtrace_filter_spec.rb
active_record-sql_analyzer-0.0.5 spec/active_record/sql_analyzer/backtrace_filter_spec.rb