Class: Mocha::BacktraceFilter
Constant Summary collapse
- LIB_DIRECTORY =
File.(File.join(File.dirname(__FILE__), "..")) + File::SEPARATOR
Instance Method Summary collapse
- #filtered(backtrace) ⇒ Object
-
#initialize(lib_directory = LIB_DIRECTORY) ⇒ BacktraceFilter
constructor
A new instance of BacktraceFilter.
Constructor Details
#initialize(lib_directory = LIB_DIRECTORY) ⇒ BacktraceFilter
Returns a new instance of BacktraceFilter.
7 8 9 |
# File 'lib/mocha/backtrace_filter.rb', line 7 def initialize(lib_directory = LIB_DIRECTORY) @lib_directory = lib_directory end |
Instance Method Details
#filtered(backtrace) ⇒ Object
11 12 13 |
# File 'lib/mocha/backtrace_filter.rb', line 11 def filtered(backtrace) backtrace.reject { |location| Regexp.new(@lib_directory).match(File.(location)) } end |