Enable the RSpec/ExpectOutput cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
06b614f9fd
commit
bdf5b6adc3
4 changed files with 15 additions and 18 deletions
|
@ -987,6 +987,9 @@ RSpec/ExampleWording:
|
||||||
RSpec/ExpectActual:
|
RSpec/ExpectActual:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
RSpec/ExpectOutput:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
# Checks the file and folder naming of the spec file.
|
# Checks the file and folder naming of the spec file.
|
||||||
RSpec/FilePath:
|
RSpec/FilePath:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
|
@ -23,10 +23,6 @@ RSpec/EmptyLineAfterFinalLet:
|
||||||
RSpec/EmptyLineAfterSubject:
|
RSpec/EmptyLineAfterSubject:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Offense count: 3
|
|
||||||
RSpec/ExpectOutput:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
# Offense count: 72
|
# Offense count: 72
|
||||||
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
||||||
# SupportedStyles: implicit, each, example
|
# SupportedStyles: implicit, each, example
|
||||||
|
|
|
@ -46,9 +46,7 @@ describe 'bin/changelog' do
|
||||||
|
|
||||||
it 'parses -h' do
|
it 'parses -h' do
|
||||||
expect do
|
expect do
|
||||||
$stdout = StringIO.new
|
expect { described_class.parse(%w[foo -h bar]) }.to output.to_stdout
|
||||||
|
|
||||||
described_class.parse(%w[foo -h bar])
|
|
||||||
end.to raise_error(SystemExit)
|
end.to raise_error(SystemExit)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -84,24 +84,24 @@ describe 'gitlab:gitaly namespace rake task' do
|
||||||
}
|
}
|
||||||
allow(Gitlab.config.repositories).to receive(:storages).and_return(config)
|
allow(Gitlab.config.repositories).to receive(:storages).and_return(config)
|
||||||
|
|
||||||
orig_stdout = $stdout
|
expected_output = ''
|
||||||
$stdout = StringIO.new
|
|
||||||
|
|
||||||
header = ''
|
|
||||||
Timecop.freeze do
|
Timecop.freeze do
|
||||||
header = <<~TOML
|
expected_output = <<~TOML
|
||||||
# Gitaly storage configuration generated from #{Gitlab.config.source} on #{Time.current.to_s(:long)}
|
# Gitaly storage configuration generated from #{Gitlab.config.source} on #{Time.current.to_s(:long)}
|
||||||
# This is in TOML format suitable for use in Gitaly's config.toml file.
|
# This is in TOML format suitable for use in Gitaly's config.toml file.
|
||||||
|
[[storage]]
|
||||||
|
name = "default"
|
||||||
|
path = "/path/to/default"
|
||||||
|
[[storage]]
|
||||||
|
name = "nfs_01"
|
||||||
|
path = "/path/to/nfs_01"
|
||||||
TOML
|
TOML
|
||||||
run_rake_task('gitlab:gitaly:storage_config')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
output = $stdout.string
|
expect { run_rake_task('gitlab:gitaly:storage_config')}.
|
||||||
$stdout = orig_stdout
|
to output(expected_output).to_stdout
|
||||||
|
|
||||||
expect(output).to include(header)
|
parsed_output = TOML.parse(expected_output)
|
||||||
|
|
||||||
parsed_output = TOML.parse(output)
|
|
||||||
config.each do |name, params|
|
config.each do |name, params|
|
||||||
expect(parsed_output['storage']).to include({ 'name' => name, 'path' => params['path'] })
|
expect(parsed_output['storage']).to include({ 'name' => name, 'path' => params['path'] })
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue