Method: M::TestCollection#within
- Defined in:
- lib/m/test_collection.rb
#within(lines) ⇒ Object
Slice out tests that may be within the given line. Returns a new TestCollection with the results.
20 21 22 23 24 25 26 |
# File 'lib/m/test_collection.rb', line 20 def within lines # Into a new collection, filter only the tests that... collection = select do |test| lines.none? || lines.any? { |line| (test.start_line..test.end_line).cover?(line) } end self.class.new collection end |