summaryrefslogtreecommitdiff
path: root/spec/unit/dsl/reboot_pending_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/dsl/reboot_pending_spec.rb')
-rw-r--r--spec/unit/dsl/reboot_pending_spec.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb
index a55f91d5e6..6705820e17 100644
--- a/spec/unit/dsl/reboot_pending_spec.rb
+++ b/spec/unit/dsl/reboot_pending_spec.rb
@@ -50,11 +50,17 @@ describe Chef::DSL::RebootPending do
expect(recipe.reboot_pending?).to be_truthy
end
- it 'should return true if value "HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile" contains specific data' do
- allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(true)
- allow(recipe).to receive(:registry_get_values).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(
- [{:name => "Flags", :type => :dword, :data => 3}])
- expect(recipe.reboot_pending?).to be_truthy
+ context "version is server 2003" do
+ before do
+ allow(Chef::Platform).to receive(:windows_server_2003?).and_return(true)
+ end
+
+ it 'should return true if value "HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile" contains specific data on 2k3' do
+ allow(recipe).to receive(:registry_key_exists?).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(true)
+ allow(recipe).to receive(:registry_get_values).with('HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile').and_return(
+ [{:name => "Flags", :type => :dword, :data => 3}])
+ expect(recipe.reboot_pending?).to be_truthy
+ end
end
end