diff options
author | JKerry <john@kerryhouse.net> | 2015-06-15 23:29:27 -0400 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-06-26 15:58:29 -0400 |
commit | 8c09a658cffd8ff8c654aab1d8ccff69342737c7 (patch) | |
tree | 627dfd4c6ef57a561cbe827017aed785ac2b3b72 /spec/unit/provider/registry_key_spec.rb | |
parent | 37c03b559913a791786ce51b8fe09473bde50368 (diff) | |
download | chef-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.rb | 12 |
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) |