summaryrefslogtreecommitdiff
path: root/spec/unit/provider/registry_key_spec.rb
diff options
context:
space:
mode:
authorJKerry <john@kerryhouse.net>2015-06-15 23:29:27 -0400
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-06-26 15:58:29 -0400
commit8c09a658cffd8ff8c654aab1d8ccff69342737c7 (patch)
tree627dfd4c6ef57a561cbe827017aed785ac2b3b72 /spec/unit/provider/registry_key_spec.rb
parent37c03b559913a791786ce51b8fe09473bde50368 (diff)
downloadchef-8c09a658cffd8ff8c654aab1d8ccff69342737c7.tar.gz
changed the registry_key provider to scan collected registry keys with downcased keys
Diffstat (limited to 'spec/unit/provider/registry_key_spec.rb')
-rw-r--r--spec/unit/provider/registry_key_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/provider/registry_key_spec.rb b/spec/unit/provider/registry_key_spec.rb
index 79811fdab8..47543ffe39 100644
--- a/spec/unit/provider/registry_key_spec.rb
+++ b/spec/unit/provider/registry_key_spec.rb
@@ -77,6 +77,18 @@ shared_examples_for "a registry key" do
end
describe "action_create" do
+ context "when a case insensitive match for the key exists" do
+ before(:each) do
+ expect(@double_registry).to receive(:key_exists?).twice.with(keyname.downcase).and_return(true)
+ end
+ it "should do nothing if the if a case insensitive key and the value both exist" do
+ @provider.new_resource.key(keyname.downcase)
+ expect(@double_registry).to receive(:get_values).with(keyname.downcase).and_return( testval1 )
+ expect(@double_registry).not_to receive(:set_value)
+ @provider.load_current_resource
+ @provider.action_create
+ end
+ end
context "when the key exists" do
before(:each) do
expect(@double_registry).to receive(:key_exists?).twice.with(keyname).and_return(true)