Class: Minitest::BacktraceFilterWithFallback

Inherits:
Object
  • Object
show all
Defined in:
railties/lib/minitest/rails_plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(preferred, fallback) ⇒ BacktraceFilterWithFallback

Returns a new instance of BacktraceFilterWithFallback.



9
10
11
12
# File 'railties/lib/minitest/rails_plugin.rb', line 9

def initialize(preferred, fallback)
  @preferred = preferred
  @fallback = fallback
end

Instance Method Details

#filter(backtrace) ⇒ Object



14
15
16
17
18
# File 'railties/lib/minitest/rails_plugin.rb', line 14

def filter(backtrace)
  filtered = @preferred.filter(backtrace)
  filtered = @fallback.filter(backtrace) if filtered.empty?
  filtered
end