-
-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete branch coverage for more files
- Loading branch information
1 parent
e80d28c
commit 9ca0da8
Showing
6 changed files
with
85 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp` | ||
# using RuboCop version 1.63.4. | ||
# using RuboCop version 1.68.0. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
Lint/ToEnumArguments: | ||
Exclude: | ||
- 'lib/rubocop/cop/rspec/multiple_expectations.rb' | ||
|
||
Rake/MethodDefinitionInTask: | ||
Exclude: | ||
- 'tasks/cut_release.rake' |
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
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,40 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe RuboCop::RSpec::Inject do | ||
describe '.defaults!' do | ||
let(:config_loader) { class_double(RuboCop::ConfigLoader).as_stubbed_const } | ||
|
||
before do | ||
rubocop_config = instance_double(RuboCop::Config) | ||
allow(config_loader).to receive(:send) | ||
.with(:load_yaml_configuration, any_args) | ||
.and_return({}) | ||
allow(RuboCop::Config).to receive(:new).and_return(rubocop_config) | ||
allow(config_loader).to receive(:merge_with_default) | ||
.and_return(rubocop_config) | ||
allow(config_loader).to receive(:instance_variable_set) | ||
end | ||
|
||
context 'when ConfigLoader.debug? is true' do | ||
before do | ||
allow(config_loader).to receive(:debug?).and_return(true) | ||
end | ||
|
||
it 'puts the configuration path' do | ||
expect { described_class.defaults! }.to output( | ||
%r{configuration from .*rubocop-rspec/config/default.yml} | ||
).to_stdout | ||
end | ||
end | ||
|
||
context 'when ConfigLoader.debug? is false' do | ||
before do | ||
allow(config_loader).to receive(:debug?).and_return(false) | ||
end | ||
|
||
it 'does not put the configuration path' do | ||
expect { described_class.defaults! }.not_to output.to_stdout | ||
end | ||
end | ||
end | ||
end |