Skip to content

Commit

Permalink
Merge pull request #437 from tmtm/fix_root_filter
Browse files Browse the repository at this point in the history
Fix root_filter evaluates SimpleCov.root before initialization.
  • Loading branch information
colszowka committed Jan 29, 2016
2 parents c07998e + 8061569 commit f4098aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/simplecov/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

SimpleCov.profiles.define "root_filter" do
# Exclude all files outside of simplecov root
root_filter = /\A#{Regexp.escape(SimpleCov.root)}/io
root_filter = nil
add_filter do |src|
root_filter ||= /\A#{Regexp.escape(SimpleCov.root)}/io
!(src.filename =~ root_filter)
end
end
Expand Down

0 comments on commit f4098aa

Please sign in to comment.