class Rails::TestUnit::Filter
:nodoc:
def ===(method)
def ===(method) return unless @runnable.method_defined?(method) if @line test_file, test_range = definition_for(@runnable.instance_method(method)) test_file == @file && test_range.include?(@line) else @runnable.instance_method(method).source_location.first == @file end end
def definition_for(method)
def definition_for(method) file, start_line = method.source_location end_line = method.source.count("\n") + start_line - 1 return file, start_line..end_line end
def initialize(runnable, file, line)
def initialize(runnable, file, line) @runnable, @file = runnable, File.expand_path(file) @line = line.to_i if line end