summaryrefslogtreecommitdiff
path: root/spec/unit/dsl
diff options
context:
space:
mode:
authorMatt Wrock <matt@mattwrock.com>2015-09-10 22:08:51 -0700
committerMatt Wrock <matt@mattwrock.com>2015-09-10 22:08:51 -0700
commit716eb7679cd30cd0e371ea8699d5dbdb47a05169 (patch)
tree1e9f35d60137c2cc22333ee37e6dd68f16b94996 /spec/unit/dsl
parentb8625814b1065da1d8e1b44523ef50ed7d8f57f0 (diff)
downloadchef-716eb7679cd30cd0e371ea8699d5dbdb47a05169.tar.gz
remove pending reboot check for HKLM\SOFTWARE\Microsoft\Updates\UpdateExeVolatile if not on windows 2003mwrock/reboot_pending
Diffstat (limited to 'spec/unit/dsl')
-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