Skip to content

Commit

Permalink
Use exclude instead of discard in the backtrace cleaner
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Phippen <samphippen@googlemail.com>
  • Loading branch information
Sam Phippen committed Mar 25, 2013
1 parent 966c6ab commit 2351e0a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/rspec/core/backtrace_cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ module Core
class BacktraceCleaner

attr_accessor :include_patterns
attr_accessor :discard_patterns
attr_accessor :exclude_patterns

def initialize(include_patterns, discard_patterns)
def initialize(include_patterns, exclude_patterns)
@include_patterns = include_patterns
@discard_patterns = discard_patterns
@exclude_patterns = exclude_patterns
end

def include?(line)
matches_an_include_pattern? line or not matches_a_discard_pattern? line
matches_an_include_pattern? line or not matches_a_exclude_pattern? line
end

private
Expand All @@ -20,8 +20,8 @@ def matches_an_include_pattern?(line)
@include_patterns.any? {|p| line =~ p}
end

def matches_a_discard_pattern?(line)
@discard_patterns.any? {|p| line =~ p}
def matches_a_exclude_pattern?(line)
@exclude_patterns.any? {|p| line =~ p}
end
end
end
Expand Down

0 comments on commit 2351e0a

Please sign in to comment.