summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrajaktaPurohit <prajakta@opscode.com>2013-01-27 18:39:04 -0800
committerdanielsdeleo <dan@opscode.com>2013-01-28 10:30:19 -0800
commit4b212ebd703f2db29a45b887762f04174eb35869 (patch)
tree9c870a93a3f8284ffe78d7e0d9727c38fe77597a
parent16acebb541de65b652f5ed3d2147e4c3d6c782b6 (diff)
downloadchef-4b212ebd703f2db29a45b887762f04174eb35869.tar.gz
Fixing unit/functional test expectations
-rw-r--r--lib/chef/win32/registry.rb2
-rw-r--r--spec/unit/registry_helper_spec.rb10
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb
index a1e9a6d237..1e8f53b464 100644
--- a/lib/chef/win32/registry.rb
+++ b/lib/chef/win32/registry.rb
@@ -135,7 +135,7 @@ class Chef
end
else
delete_key_ex(hive_namespace, key_including_parent)
- return
+ return true
end
true
end
diff --git a/spec/unit/registry_helper_spec.rb b/spec/unit/registry_helper_spec.rb
index 6a0e4270f0..49469b27e6 100644
--- a/spec/unit/registry_helper_spec.rb
+++ b/spec/unit/registry_helper_spec.rb
@@ -164,8 +164,11 @@ describe Chef::Provider::RegistryKey do
@registry.should_receive(:key_exists?).with(key_path).and_return(true)
@registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
@registry.should_receive(:has_subkeys?).with(key_path).and_return(true)
- @hive_mock.should_receive(:open).with(key_parent, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:delete_key).with(key_to_delete, true)
+ @registry.should_receive(:get_subkeys).with(key_path).and_return([sub_key])
+ @registry.should_receive(:key_exists?).with(key_path+"\\"+sub_key).and_return(true)
+ @registry.should_receive(:get_hive_and_key).with(key_path+"\\"+sub_key).and_return([@hive_mock, key+"\\"+sub_key])
+ @registry.should_receive(:has_subkeys?).with(key_path+"\\"+sub_key).and_return(false)
+ @registry.should_receive(:delete_key_ex).twice
@registry.delete_key(key_path, true)
end
@@ -180,8 +183,7 @@ describe Chef::Provider::RegistryKey do
@registry.should_receive(:key_exists?).with(key_path).and_return(true)
@registry.should_receive(:get_hive_and_key).with(key_path).and_return([@hive_mock, key])
@registry.should_receive(:has_subkeys?).with(key_path).and_return(false)
- @hive_mock.should_receive(:open).with(key_parent, ::Win32::Registry::KEY_WRITE | @registry.registry_system_architecture).and_yield(@reg_mock)
- @reg_mock.should_receive(:delete_key).with(key_to_delete)
+ @registry.should_receive(:delete_key_ex)
@registry.delete_key(key_path, true)
end
end