diff options
author | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2016-09-13 16:19:00 +0530 |
---|---|---|
committer | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2016-09-13 16:19:00 +0530 |
commit | e1a8db1d5b8e6d6703659bf334da6ac4274ebce1 (patch) | |
tree | b9f9e553413f9fb7e038cea49ce1353d32b2b1ae | |
parent | 3ae511bdc32802ffc832a4548bb1cbcd34205a36 (diff) | |
download | chef-e1a8db1d5b8e6d6703659bf334da6ac4274ebce1.tar.gz |
Added functional specs for registry key
-rw-r--r-- | spec/functional/resource/registry_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/functional/resource/registry_spec.rb b/spec/functional/resource/registry_spec.rb index e64b6697c5..1cea71e636 100644 --- a/spec/functional/resource/registry_spec.rb +++ b/spec/functional/resource/registry_spec.rb @@ -153,6 +153,15 @@ describe Chef::Resource::RegistryKey, :windows_only, :broken => true do expect(@registry.data_exists?(reg_child, { :name => "Color", :type => :string, :data => "Orange" })).to eq(true) end + it "does not create the key if it already exists with same value and type but datatype of data differs" do + @new_resource.key(reg_child) + @new_resource.values([{ :name => "number", :type => :dword, :data => "12345" }]) + @new_resource.run_action(:create) + + expect(@registry.key_exists?(reg_child)).to eq(true) + expect(@registry.data_exists?(reg_child, { :name => "number", :type => :dword, :data => 12345 })).to eq(true) + end + it "creates a value if it does not exist" do @new_resource.key(reg_child) @new_resource.values([{ :name => "Mango", :type => :string, :data => "Yellow" }]) |