lib/covered/files.rb in covered-0.16.9 vs lib/covered/files.rb in covered-0.17.0

- old
+ new

@@ -21,19 +21,19 @@ def empty? @paths.empty? end def mark(path, lineno, value) - coverage = (@paths[path] ||= Coverage.new(path)) + coverage = (@paths[path] ||= Coverage.for(path)) coverage.mark(lineno, value) return coverage end - def add(path, source = nil) - @paths[path] ||= Coverage.new(path) + def add(source) + @paths[source.path] ||= Coverage.new(source) end def each(&block) @paths.each_value(&block) end @@ -71,10 +71,10 @@ yield coverage end paths.each do |path| - yield Coverage.new(path) + yield Coverage.for(path) end end end class Skip < Filter