lib/undercover/result.rb in undercover-0.3.3 vs lib/undercover/result.rb in undercover-0.3.4
- old
+ new
@@ -6,17 +6,26 @@
class Result
extend Forwardable
attr_reader :node, :coverage, :file_path
- def_delegators :node, :first_line, :last_line
+ def_delegators :node, :first_line, :last_line, :name
def initialize(node, file_cov, file_path)
@node = node
@coverage = file_cov.select do |ln, _|
ln > first_line && ln < last_line
end
@file_path = file_path
+ @flagged = false
+ end
+
+ def flag
+ @flagged = true
+ end
+
+ def flagged?
+ @flagged
end
# TODO: make DRY
def non_code?(line_no)
line_cov = coverage.find { |ln, _cov| ln == line_no }