diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2016-03-03 09:23:42 -0800 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2016-03-03 09:23:42 -0800 |
commit | 5979a39fbbb3640283eb81c8bce68ac2b509783c (patch) | |
tree | 1a890b04d2f21e8145eea60f753b2e433a6c79fe /spec/unit | |
parent | 383e681013bdd188f208753f9be60b4b9580aa52 (diff) | |
parent | 8f5f95b90db1b9f5fc4a30a9e54ebfd81cce5177 (diff) | |
download | chef-5979a39fbbb3640283eb81c8bce68ac2b509783c.tar.gz |
Merge pull request #4655 from coderanger/solobag
Clearer exception for loading non-existent data bag items in solo mode.
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/data_bag_item_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/data_bag_item_spec.rb b/spec/unit/data_bag_item_spec.rb index 7f7d2b3013..c5a4403283 100644 --- a/spec/unit/data_bag_item_spec.rb +++ b/spec/unit/data_bag_item_spec.rb @@ -325,6 +325,11 @@ describe Chef::DataBagItem do expect(item).to be_a_kind_of(Chef::DataBagItem) expect(item).to eq(data_bag_item) end + + it "raises an exception for unknown items" do + expect(Chef::DataBag).to receive(:load).with("users").and_return({ "charlie" => data_bag_item.to_hash }) + expect { Chef::DataBagItem.load("users", "wonka") }.to raise_error Chef::Exceptions::InvalidDataBagItemID + end end end end |