Fixing WinRM communicator unit test.
This commit is contained in:
parent
18d229ca82
commit
44154c92a9
|
@ -20,6 +20,7 @@ describe VagrantPlugins::CommunicatorWinRM::Communicator do
|
||||||
before do
|
before do
|
||||||
allow(shell).to receive(:username).and_return('vagrant')
|
allow(shell).to receive(:username).and_return('vagrant')
|
||||||
allow(shell).to receive(:password).and_return('password')
|
allow(shell).to receive(:password).and_return('password')
|
||||||
|
allow(shell).to receive(:execution_time_limit).and_return('PT2H')
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".ready?" do
|
describe ".ready?" do
|
||||||
|
@ -56,7 +57,7 @@ describe VagrantPlugins::CommunicatorWinRM::Communicator do
|
||||||
expect(shell).to receive(:upload).with(kind_of(String), "c:/tmp/vagrant-elevated-shell.ps1")
|
expect(shell).to receive(:upload).with(kind_of(String), "c:/tmp/vagrant-elevated-shell.ps1")
|
||||||
expect(shell).to receive(:powershell) do |cmd|
|
expect(shell).to receive(:powershell) do |cmd|
|
||||||
expect(cmd).to eq("powershell -executionpolicy bypass -file \"c:/tmp/vagrant-elevated-shell.ps1\" " +
|
expect(cmd).to eq("powershell -executionpolicy bypass -file \"c:/tmp/vagrant-elevated-shell.ps1\" " +
|
||||||
"-username \"vagrant\" -password \"password\" -encoded_command \"ZABpAHIAOwAgAGUAeABpAHQAIAAkAEwAQQBTAFQARQBYAEkAVABDAE8ARABFAA==\"")
|
"-username \"vagrant\" -password \"password\" -encoded_command \"ZABpAHIAOwAgAGUAeABpAHQAIAAkAEwAQQBTAFQARQBYAEkAVABDAE8ARABFAA==\" -execution_time_limit \"PT2H\"")
|
||||||
end.and_return({ exitcode: 0 })
|
end.and_return({ exitcode: 0 })
|
||||||
expect(subject.execute("dir", { elevated: true })).to eq(0)
|
expect(subject.execute("dir", { elevated: true })).to eq(0)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue