summaryrefslogtreecommitdiff
path: root/spec/unit/data_bag_spec.rb
diff options
context:
space:
mode:
authorHiroaki Nakamura <hnakamur@gmail.com>2013-04-11 05:21:43 +0900
committerBryan McLellan <btm@opscode.com>2013-05-24 10:32:06 -0700
commitc6154f5c6e5e6c4692642c9f50490aaca939dc87 (patch)
tree4fac08107f62cef18d6d41acab7427b3c824a43a /spec/unit/data_bag_spec.rb
parent68ff2b7e66181d636e574641f29ace0d10f7c2b7 (diff)
downloadchef-c6154f5c6e5e6c4692642c9f50490aaca939dc87.tar.gz
Add a regression test to 'spec/unit/data_bag_spec.rb' to make sure that
Chef::DataBag#list works in chef-solo.
Diffstat (limited to 'spec/unit/data_bag_spec.rb')
-rw-r--r--spec/unit/data_bag_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/unit/data_bag_spec.rb b/spec/unit/data_bag_spec.rb
index ec45e28a9b..51e01ef454 100644
--- a/spec/unit/data_bag_spec.rb
+++ b/spec/unit/data_bag_spec.rb
@@ -155,6 +155,13 @@ describe Chef::DataBag do
data_bag.should == { 'bar' => { 'id' => 'bar', 'name' => 'Bob Bar' }, 'baz' => { 'id' => 'baz', 'name' => 'John Baz' }}
end
+ it "should return the data bag list" do
+ File.should_receive(:directory?).with('/var/chef/data_bags').and_return(true)
+ Dir.should_receive(:glob).and_return(["/var/chef/data_bags/foo", "/var/chef/data_bags/bar"])
+ data_bag_list = Chef::DataBag.list
+ data_bag_list.should == [ 'bar', 'foo' ]
+ end
+
it 'should raise an error if the configured data_bag_path is invalid' do
File.should_receive(:directory?).with('/var/chef/data_bags').and_return(false)