Skip to content
代码片段 群组 项目
提交 d6b121b7 编辑于 作者: Nick Thomas's avatar Nick Thomas
浏览文件

CE->EE: Fix conflicts in spec/lib/gitlab/shell_spec.rb

上级 9ef6b3b0
No related branches found
No related tags found
无相关合并请求
......@@ -545,7 +545,6 @@ def build_ssh_auth(opts = {})
it 'raises an exception when the command fails' do
expect_popen.and_return(["error", 1])
<<<<<<< HEAD
expect { fetch_remote }.to raise_error(Gitlab::Shell::Error, "error")
end
......@@ -596,58 +595,6 @@ def build_ssh_auth(opts = {})
ssh_auth = build_ssh_auth(ssh_import?: false, ssh_known_hosts: 'foo')
=======
expect { fetch_remote }.to raise_error(Gitlab::Shell::Error, "error")
end
context 'SSH auth' do
it 'passes the SSH key if specified' do
expect_popen('GITLAB_SHELL_SSH_KEY' => 'foo').and_return([nil, 0])
ssh_auth = build_ssh_auth(ssh_key_auth?: true, ssh_private_key: 'foo')
expect(fetch_remote(ssh_auth)).to be_truthy
end
it 'does not pass an empty SSH key' do
expect_popen.and_return([nil, 0])
ssh_auth = build_ssh_auth(ssh_key_auth: true, ssh_private_key: '')
expect(fetch_remote(ssh_auth)).to be_truthy
end
it 'does not pass the key unless SSH key auth is to be used' do
expect_popen.and_return([nil, 0])
ssh_auth = build_ssh_auth(ssh_key_auth: false, ssh_private_key: 'foo')
expect(fetch_remote(ssh_auth)).to be_truthy
end
it 'passes the known_hosts data if specified' do
expect_popen('GITLAB_SHELL_KNOWN_HOSTS' => 'foo').and_return([nil, 0])
ssh_auth = build_ssh_auth(ssh_known_hosts: 'foo')
expect(fetch_remote(ssh_auth)).to be_truthy
end
it 'does not pass empty known_hosts data' do
expect_popen.and_return([nil, 0])
ssh_auth = build_ssh_auth(ssh_known_hosts: '')
expect(fetch_remote(ssh_auth)).to be_truthy
end
it 'does not pass known_hosts data unless SSH is to be used' do
expect_popen(popen_vars).and_return([nil, 0])
ssh_auth = build_ssh_auth(ssh_import?: false, ssh_known_hosts: 'foo')
>>>>>>> upstream/master
expect(fetch_remote(ssh_auth)).to be_truthy
end
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册