More tests

This commit is contained in:
Emilien Kenler 2014-04-14 17:29:10 +09:00 committed by Mitchell Hashimoto
parent b77bd3e6bb
commit 744e5b9b30
1 changed files with 30 additions and 0 deletions

View File

@ -270,6 +270,7 @@ VF
before do before do
config.sudo = false config.sudo = false
config.ask_sudo_pass = false config.ask_sudo_pass = false
config.ask_vault_pass = false
config.sudo_user = 'root' config.sudo_user = 'root'
end end
@ -281,6 +282,7 @@ VF
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args| expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
expect(args.index("--sudo")).to be_nil expect(args.index("--sudo")).to be_nil
expect(args.index("--ask-sudo-pass")).to be_nil expect(args.index("--ask-sudo-pass")).to be_nil
expect(args.index("--ask-vault-pass")).to be_nil
} }
end end
end end
@ -355,6 +357,34 @@ VF
end end
end end
describe "with ask_vault_pass option" do
before do
config.ask_vault_pass = true
end
it_should_set_arguments_and_environment_variables 6
it "should ask the vault password" do
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
expect(args).to include("--ask-vault-pass")
}
end
end
describe "with vault_password_file option" do
before do
config.vault_password_file = existing_file
end
it_should_set_arguments_and_environment_variables 6
it "uses the given vault password file" do
expect(Vagrant::Util::Subprocess).to receive(:execute).with { |*args|
expect(args).to include("--vault-password-file=#{existing_file}")
}
end
end
describe "with raw_ssh_args" do describe "with raw_ssh_args" do
before do before do
config.raw_ssh_args = ['-o ControlMaster=no'] config.raw_ssh_args = ['-o ControlMaster=no']