diff options
author | Lamont Granquist <lamont@chef.io> | 2020-06-26 11:17:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-26 11:17:25 -0700 |
commit | 451cd8e5db0a78b68db7e493f2ff73a473171d8b (patch) | |
tree | 403610474b5dd9b08bb89329cbcaee6cd7442212 /spec/unit/data_bag_spec.rb | |
parent | 2ddf671999fc5b8261eb1dbf5572fda41bd65851 (diff) | |
parent | 8dffd98327782cec61f5e3765789a84c563d85d2 (diff) | |
download | chef-451cd8e5db0a78b68db7e493f2ff73a473171d8b.tar.gz |
Merge pull request #10074 from chef/lcg/win-unit-test-cherrypick
Pick some of the unit test fixes from #10068
Diffstat (limited to 'spec/unit/data_bag_spec.rb')
-rw-r--r-- | spec/unit/data_bag_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/unit/data_bag_spec.rb b/spec/unit/data_bag_spec.rb index 7e5ef46d58..2a7ddddd5b 100644 --- a/spec/unit/data_bag_spec.rb +++ b/spec/unit/data_bag_spec.rb @@ -240,20 +240,23 @@ describe Chef::DataBag do it "should raise an error if the configured data_bag_path is invalid" do file_dir_stub(@paths.first, false) + msg = "Data bag path '#{windows? ? "C:/var/chef" : "/var/chef"}/data_bags' not found. Please create this directory." expect do Chef::DataBag.load("foo") - end.to raise_error Chef::Exceptions::InvalidDataBagPath, "Data bag path '/var/chef/data_bags' not found. Please create this directory." + end.to raise_error Chef::Exceptions::InvalidDataBagPath, msg end end describe "data bag with string path" do - it_should_behave_like "data bag in solo mode", "/var/chef/data_bags" + it_should_behave_like "data bag in solo mode", "#{windows? ? "C:/var/chef" : "/var/chef"}/data_bags" end describe "data bag with array path" do - it_should_behave_like "data bag in solo mode", ["/var/chef/data_bags", "/var/chef/data_bags_2"] + it_should_behave_like "data bag in solo mode", %w{data_bags data_bags_2}.map { |data_bag| + "#{windows? ? "C:/var/chef" : "/var/chef"}/#{data_bag}" + } end end |