diff options
author | Rémy Coutable <remy@rymai.me> | 2017-05-18 18:56:26 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-18 18:56:26 +0200 |
commit | bdf5b6adc34ae2856bddea62ce449fa452aee761 (patch) | |
tree | 5caaa4a12c6939cb1d4e2daaabe4a3714ff67cb4 /spec/tasks | |
parent | 06b614f9fd7a311b9cbc6ad90eecb4cfc5281c78 (diff) | |
download | gitlab-ce-bdf5b6adc34ae2856bddea62ce449fa452aee761.tar.gz |
Enable the RSpec/ExpectOutput coprubocop-expect-output
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/gitaly_rake_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/tasks/gitlab/gitaly_rake_spec.rb b/spec/tasks/gitlab/gitaly_rake_spec.rb index f035504320b..4a636decafd 100644 --- a/spec/tasks/gitlab/gitaly_rake_spec.rb +++ b/spec/tasks/gitlab/gitaly_rake_spec.rb @@ -84,24 +84,24 @@ describe 'gitlab:gitaly namespace rake task' do } allow(Gitlab.config.repositories).to receive(:storages).and_return(config) - orig_stdout = $stdout - $stdout = StringIO.new - - header = '' + expected_output = '' Timecop.freeze do - header = <<~TOML + expected_output = <<~TOML # 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. + [[storage]] + name = "default" + path = "/path/to/default" + [[storage]] + name = "nfs_01" + path = "/path/to/nfs_01" TOML - run_rake_task('gitlab:gitaly:storage_config') end - output = $stdout.string - $stdout = orig_stdout - - expect(output).to include(header) + expect { run_rake_task('gitlab:gitaly:storage_config')}. + to output(expected_output).to_stdout - parsed_output = TOML.parse(output) + parsed_output = TOML.parse(expected_output) config.each do |name, params| expect(parsed_output['storage']).to include({ 'name' => name, 'path' => params['path'] }) end |