Skip to content

Commit

Permalink
Merge pull request #447 from craiglittle/fix-ivar-warning
Browse files Browse the repository at this point in the history
Silence `@track_files_glob` ivar warning
  • Loading branch information
colszowka committed Jan 25, 2016
2 parents b08b8d9 + 8c1730d commit 058dbba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/simplecov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def start(profile = nil, &block)
# their coverage to zero.
#
def add_not_loaded_files(result)
if @track_files_glob
if track_files
result = result.dup
Dir[@track_files_glob].each do |file|
Dir[track_files].each do |file|
absolute = File.expand_path(file)

result[absolute] ||= [0] * File.foreach(absolute).count
Expand Down
5 changes: 3 additions & 2 deletions lib/simplecov/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ def coverage_path
# or not they were explicitly required. Without this, un-required files
# will not be present in the final report.
#
def track_files(glob)
@track_files_glob = glob
def track_files(glob = nil)
return @track_files if defined?(@track_files) && glob.nil?
@track_files = glob
end

#
Expand Down

0 comments on commit 058dbba

Please sign in to comment.