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
cffb463
commit 67a26d4
Showing
3 changed files
with
41 additions
and
5 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,29 @@ | ||
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 | ||
|
||
context "when unconfigured" do | ||
it "returns nil" do | ||
expect(SimpleCov.tracked_files).to be_nil | ||
end | ||
end | ||
end | ||
end |