From 3efb4b1def4a28489af9fe27f02c6ab323c16500 Mon Sep 17 00:00:00 2001 From: Shawn Neal Date: Wed, 23 Apr 2014 18:05:53 -0700 Subject: [PATCH] Allow WinRM shell test less restrictive This will allow the shell class to append additional commands like exit $EXITCODE --- test/unit/plugins/communicators/winrm/shell_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/plugins/communicators/winrm/shell_test.rb b/test/unit/plugins/communicators/winrm/shell_test.rb index 79d6970d8..477108b97 100644 --- a/test/unit/plugins/communicators/winrm/shell_test.rb +++ b/test/unit/plugins/communicators/winrm/shell_test.rb @@ -15,19 +15,19 @@ describe VagrantPlugins::CommunicatorWinRM::WinRMShell do describe ".powershell" do it "should call winrm powershell" do - expect(session).to receive(:powershell).with("dir").and_return({ exitcode: 0 }) + expect(session).to receive(:powershell).with(/^dir.+/).and_return({ exitcode: 0 }) expect(subject.powershell("dir")[:exitcode]).to eq(0) end it "should raise auth error when exception message contains 401" do - expect(session).to receive(:powershell).with("dir").and_raise( + expect(session).to receive(:powershell).with(/^dir.+/).and_raise( StandardError.new("Oh no! a 401 SOAP error!")) expect { subject.powershell("dir") }.to raise_error( VagrantPlugins::CommunicatorWinRM::Errors::AuthError) end it "should raise an execution error when an exception occurs" do - expect(session).to receive(:powershell).with("dir").and_raise( + expect(session).to receive(:powershell).with(/^dir.+/).and_raise( StandardError.new("Oh no! a 500 SOAP error!")) expect { subject.powershell("dir") }.to raise_error( VagrantPlugins::CommunicatorWinRM::Errors::ExecutionError)