see if `%` is replaced with `%%`

This commit is contained in:
Tomoyuki Sakurai 2016-10-04 22:05:45 +09:00 committed by Brian Cain
parent a76dfc7b37
commit bf7c34ab9d
1 changed files with 14 additions and 0 deletions

View File

@ -678,6 +678,20 @@ VF
end end
end end
describe "with an identity file containing `%`" do
before do
ssh_info[:private_key_path] = ['/foo%bar/key', '/bar%%buz/key']
end
it "replaces `%` with `%%`" do
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
cmd_opts = args.last
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o 'IdentityFile=/foo%%bar/key'")
expect(cmd_opts[:env]['ANSIBLE_SSH_ARGS']).to include("-o 'IdentityFile=/bar%%%%buz/key'")
}
end
end
describe "with ssh forwarding enabled" do describe "with ssh forwarding enabled" do
before do before do
ssh_info[:forward_agent] = true ssh_info[:forward_agent] = true