From 44154c92a90e32b5b5189ece0d12f086198bdd77 Mon Sep 17 00:00:00 2001 From: Jeremy Roberts Date: Sun, 30 Aug 2015 21:08:39 -0400 Subject: [PATCH] Fixing WinRM communicator unit test. --- test/unit/plugins/communicators/winrm/communicator_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/plugins/communicators/winrm/communicator_test.rb b/test/unit/plugins/communicators/winrm/communicator_test.rb index ceea0985d..42588a511 100644 --- a/test/unit/plugins/communicators/winrm/communicator_test.rb +++ b/test/unit/plugins/communicators/winrm/communicator_test.rb @@ -20,6 +20,7 @@ describe VagrantPlugins::CommunicatorWinRM::Communicator do before do allow(shell).to receive(:username).and_return('vagrant') allow(shell).to receive(:password).and_return('password') + allow(shell).to receive(:execution_time_limit).and_return('PT2H') end 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(:powershell) do |cmd| 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 }) expect(subject.execute("dir", { elevated: true })).to eq(0) end