diff options
author | Tim Smith <tsmith@chef.io> | 2017-10-18 16:12:58 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-10-19 15:07:13 -0700 |
commit | 90e6ac9a899f6aae856b661f7c8a835aa0ba5c22 (patch) | |
tree | 3e0274d0a6650ac090e0bce6c7fc4fecbc1a8a9a /spec/unit/mixin | |
parent | 25dd1d9dadb68224f600aabc7d05326acfef4d27 (diff) | |
download | chef-90e6ac9a899f6aae856b661f7c8a835aa0ba5c22.tar.gz |
Fix remote_file with UNC paths failingnodes_not_here
Our check here to see if we're on Windows uses node data that's not
available in this context. Use the same Chef::Platform.windows? check we
use above. Without this you get the following error:
[2017-10-02T21:40:42+00:00] DEBUG: Re-raising exception: NameError - remote_file[c:/foo/bar] (foo::default line 14) had an error: NameError: undefined local variable or method `node' for #<Chef::Provider::RemoteFile::NetworkFile:0x00000000064c0148>
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/mixin')
-rw-r--r-- | spec/unit/mixin/user_context_spec.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/spec/unit/mixin/user_context_spec.rb b/spec/unit/mixin/user_context_spec.rb index f2119b6dbc..3dadf6a2c3 100644 --- a/spec/unit/mixin/user_context_spec.rb +++ b/spec/unit/mixin/user_context_spec.rb @@ -41,7 +41,6 @@ describe "a class that mixes in user_context" do before do allow(::Chef::Platform).to receive(:windows?).and_return(true) allow(::Chef::Util::Windows::LogonSession).to receive(:new).and_return(logon_session) - allow(instance_with_user_context).to receive(:node).and_return({ "platform_family" => "windows" }) end let(:logon_session) { instance_double("::Chef::Util::Windows::LogonSession", :set_user_context => nil, :open => nil, :close => nil) } @@ -99,7 +98,7 @@ describe "a class that mixes in user_context" do context "when not running on Windows" do before do - allow(instance_with_user_context).to receive(:node).and_return({ "platform_family" => "ubuntu" }) + allow(::Chef::Platform).to receive(:windows?).and_return(false) end it "raises a ::Chef::Exceptions::UnsupportedPlatform exception" do |