summaryrefslogtreecommitdiff
path: root/spec/functional/resource/registry_spec.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@opscode.com>2012-11-30 16:52:59 -0800
committerLamont Granquist <lamont@opscode.com>2012-12-19 15:56:08 -0800
commitc0a86531a69c322b4be2599161f1bdd91cde56e9 (patch)
treefe3fdc26472f5cad64b4216bf86b79ccb9ceba25 /spec/functional/resource/registry_spec.rb
parent8592a04b0de9c4bbf809e5529f1d0a64c2d3cbbb (diff)
downloadchef-c0a86531a69c322b4be2599161f1bdd91cde56e9.tar.gz
add a 64-bit test
Diffstat (limited to 'spec/functional/resource/registry_spec.rb')
-rw-r--r--spec/functional/resource/registry_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb
index 360d9ec451..ff95f23cf9 100644
--- a/spec/functional/resource/registry_spec.rb
+++ b/spec/functional/resource/registry_spec.rb
@@ -130,6 +130,35 @@ describe Chef::Resource::RegistryKey, :windows_only do
@registry.value_exists?("HKCU\\Software\\MissingKey1\\MissingKey2\\Opscode", value).should == true
end
end
+ context "when running on 64-bit server", :windows64_only do
+ before(:all) do
+ ::Win32::Registry::HKEY_LOCAL_MACHINE.open("Software", Win32::Registry::KEY_WRITE) do |reg|
+ begin
+ reg.delete_key("Opscode", true)
+ rescue
+ end
+ end
+ end
+ after(:all) do
+ ::Win32::Registry::HKEY_LOCAL_MACHINE.open("Software", Win32::Registry::KEY_WRITE) do |reg|
+ begin
+ reg.delete_key("Opscode", true)
+ rescue
+ end
+ end
+ end
+ it "creates a key in a 32-bit registry that is not viewable in 64-bit" do
+ @resource.key("HKLM\\Software\\Opscode\\Whatever")
+ @resource.values([{:name=>"OC", :type=>:string, :data=>"Data"}])
+ @resource.recursive(true)
+ @resource.architecture(:i386)
+ @resource.run_action(:create)
+ @registry.architecture = "i386"
+ @registry.data_exists?("HKLM\\Software\\Opscode\\Whatever", {:name=>"OC", :type=>:string, :data=>"Data"}).should == true
+ @registry.architecture = "x86_64"
+ @registry.key_exists?("HKLM\\Software\\Opscode\\Whatever").should == false
+ end
+ end
end
context "when action is create_if_missing" do