diff options
author | John McCrae <john.mccrae@progress.com> | 2021-06-02 09:40:11 -0700 |
---|---|---|
committer | John McCrae <john.mccrae@progress.com> | 2021-06-02 09:40:11 -0700 |
commit | 17f55412e2aa7e2c0dc9f16f7893b09cb0f95a2d (patch) | |
tree | 2cfb6576947d5027e6e5298b213da941fbe922cd /spec | |
parent | c76c7f7aaf136896df9b8c836597a0e5a1653463 (diff) | |
download | chef-17f55412e2aa7e2c0dc9f16f7893b09cb0f95a2d.tar.gz |
Updated the Windows Pagefile resource to use PowerShell over WMI, added a corresponding test file
Signed-off-by: John McCrae <john.mccrae@progress.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/functional/resource/windows_pagefile_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/resource/windows_pagefile_spec.rb | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/spec/functional/resource/windows_pagefile_spec.rb b/spec/functional/resource/windows_pagefile_spec.rb index 25ec8455c8..c627b6708f 100644 --- a/spec/functional/resource/windows_pagefile_spec.rb +++ b/spec/functional/resource/windows_pagefile_spec.rb @@ -21,8 +21,8 @@ require "chef/mixin/powershell_exec" describe Chef::Resource::WindowsPagefile, :windows_only do include Chef::Mixin::PowershellExec - let(:c_path) { "C" } - let(:e_path) { "E" } + let(:c_path) { "c:\pagefile.sys" } + let(:e_path) { "e:\pagefile.sys" } let(:run_context) do node = Chef::Node.new diff --git a/spec/unit/resource/windows_pagefile_spec.rb b/spec/unit/resource/windows_pagefile_spec.rb index e8e81cd63e..e11b096fc0 100644 --- a/spec/unit/resource/windows_pagefile_spec.rb +++ b/spec/unit/resource/windows_pagefile_spec.rb @@ -18,14 +18,14 @@ require "spec_helper" describe Chef::Resource::WindowsPagefile do - let(:resource) { Chef::Resource::WindowsPagefile.new("C:\\pagefile.sys") } + let(:resource) { Chef::Resource::WindowsPagefile.new("c:\\pagefile.sys") } it "sets resource name as :windows_pagefile" do expect(resource.resource_name).to eql(:windows_pagefile) end it "the path property is the name_property" do - expect(resource.path).to eql("C") + expect(resource.path).to eql("c:\\pagefile.sys") end it "sets the default action as :set" do @@ -38,7 +38,7 @@ describe Chef::Resource::WindowsPagefile do end it "coerces forward slashes in the path property to back slashes" do - resource.path "C:/pagefile.sys" - expect(resource.path).to eql("C") + resource.path "c:/pagefile.sys" + expect(resource.path).to eql("c:\\pagefile.sys") end end |