From 337b200d304505159a6c00148a71ff0cffd1a443 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 24 Oct 2017 12:08:38 -0700 Subject: [PATCH] Update rspec tests to remove deprecation warnings --- test/unit/plugins/communicators/winrm/helper_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/plugins/communicators/winrm/helper_test.rb b/test/unit/plugins/communicators/winrm/helper_test.rb index 316966d49..1bf5beebb 100644 --- a/test/unit/plugins/communicators/winrm/helper_test.rb +++ b/test/unit/plugins/communicators/winrm/helper_test.rb @@ -50,7 +50,7 @@ describe VagrantPlugins::CommunicatorWinRM::Helper do end it "raise an exception if it detects an APIPA" do - machine.stub(ssh_info: { host: "169.254.123.123" }) + allow(machine).to receive(:ssh_info).and_return({ host: "169.254.123.123" }) expect { subject.winrm_address(machine) }. to raise_error(VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady) end @@ -166,12 +166,12 @@ describe VagrantPlugins::CommunicatorWinRM::Helper do end it "returns true if it detects an APIPA" do - machine.stub(ssh_info: { host: "169.254.123.123" }) + allow(machine).to receive(:ssh_info).and_return({ host: "169.254.123.123" }) expect(subject).to be_winrm_info_invalid(machine.ssh_info) end it "returns false if the IP is valid" do - machine.stub(ssh_info: { host: "192.168.123.123" }) + allow(machine).to receive(:ssh_info).and_return({ host: "192.168.123.123" }) expect(subject).not_to be_winrm_info_invalid(machine.ssh_info) end end