diff options
author | Pete Higgins <pete@peterhiggins.org> | 2020-07-07 18:42:26 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-07-07 18:42:26 -0700 |
commit | 0ee7d1ac043ca24e6ecef92073a78e4a1d1566c2 (patch) | |
tree | f0b72f3115fd3c399d65505c0d5637bdff573a49 | |
parent | 8227b7f1ab1bc7bf14815af3eafc08fe4b60b022 (diff) | |
download | chef-0ee7d1ac043ca24e6ecef92073a78e4a1d1566c2.tar.gz |
Refer to the new_resource directly.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r-- | spec/unit/provider/package/windows_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/provider/package/windows_spec.rb b/spec/unit/provider/package/windows_spec.rb index 6df633d75d..b9a32ffd66 100644 --- a/spec/unit/provider/package/windows_spec.rb +++ b/spec/unit/provider/package/windows_spec.rb @@ -42,7 +42,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:cache_path) { 'c:\\cache\\' } before(:each) do - allow(::File).to receive(:exist?).with(provider.new_resource.source).and_return(true) + allow(::File).to receive(:exist?).with(new_resource.source).and_return(true) end describe "load_current_resource" do @@ -66,7 +66,7 @@ describe Chef::Provider::Package::Windows, :windows_only do it "sets the version to be installed" do provider.load_current_resource - expect(provider.new_resource.version).to eql("2.0") + expect(new_resource.version).to eql("2.0") end end @@ -234,7 +234,7 @@ describe Chef::Provider::Package::Windows, :windows_only do end it "returns the resource's installer_type if it is set" do - provider.new_resource.installer_type(:nsis) + new_resource.installer_type(:nsis) expect(provider.installer_type).to eql(:nsis) end @@ -275,7 +275,7 @@ describe Chef::Provider::Package::Windows, :windows_only do it "raises an error" do allow(::Kernel).to receive(:open).and_yield(StringIO.new("")) - provider.new_resource.installer_type(nil) + new_resource.installer_type(nil) expect { provider.installer_type }.to raise_error(Chef::Exceptions::CannotDetermineWindowsInstallerType) end end @@ -400,7 +400,7 @@ describe Chef::Provider::Package::Windows, :windows_only do let(:resource_source) { "C:/a_missing_file.exe" } let(:installer_type) { nil } before do - allow(::File).to receive(:exist?).with(provider.new_resource.source).and_return(false) + allow(::File).to receive(:exist?).with(new_resource.source).and_return(false) provider.load_current_resource end |