forked from simplecov-ruby/simplecov
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
track_files
work when configured with nil
Fixes simplecov-ruby#462. The implementation of `track_files` was refactored recently to suppress a warning in the underlying instance variable had not been initialized. This had the effect of changing the behavior when trying to nullify the default configuration of tracked files in some cases through the use of nil. With this change, a declaration of `track_files nil` will once again clear out any previous configuration and essentially disable the feature. Reference: * simplecov-ruby#447 * simplecov-ruby#462
- Loading branch information
1 parent
15ec12e
commit 4058c2b
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require "helper" | ||
|
||
describe SimpleCov::Configuration do | ||
describe "#tracked_files" do | ||
context "when configured" do | ||
let(:glob) { "{app,lib}/**/*.rb" } | ||
|
||
before { SimpleCov.track_files(glob) } | ||
|
||
it "returns the configured glob" do | ||
expect(SimpleCov.tracked_files).to eq glob | ||
end | ||
|
||
context "and configured again with nil" do | ||
before { SimpleCov.track_files(nil) } | ||
|
||
it "returns nil" do | ||
expect(SimpleCov.tracked_files).to be_nil | ||
end | ||
end | ||
end | ||
end | ||
end |