summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2021-05-24 11:40:37 -0700
committerGitHub <noreply@github.com>2021-05-24 11:40:37 -0700
commitc88bd0ff2c6c9255e7392bf41a61a07e6e511261 (patch)
tree77ad74f87306f1c2c739d933e09df9a43062cdc2 /spec
parent0b3cb32dd226952f095beebb4fd3fbbdea85008e (diff)
parent19f127b7ff177bed0a0ebdfd2e0720f6acfc6bd2 (diff)
downloadchef-c88bd0ff2c6c9255e7392bf41a61a07e6e511261.tar.gz
Merge pull request #11569 from MsysTechnologiesllc/sangmeshA/Fix_Validation_failed_while_creating_databag_and_databag_item
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/data_bag_item_spec.rb4
-rw-r--r--spec/unit/data_bag_spec.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/unit/data_bag_item_spec.rb b/spec/unit/data_bag_item_spec.rb
index 61e0a80444..2487bd25d7 100644
--- a/spec/unit/data_bag_item_spec.rb
+++ b/spec/unit/data_bag_item_spec.rb
@@ -73,11 +73,11 @@ describe Chef::DataBagItem do
end
it "should accept alphanum.alphanum for the id" do
- expect { data_bag_item.raw_data = { "id" => "foo.bar" } }.not_to raise_error
+ expect { data_bag_item.raw_data = { "id" => "foo.bar" } }.to raise_error(ArgumentError)
end
it "should accept .alphanum for the id" do
- expect { data_bag_item.raw_data = { "id" => ".bozo" } }.not_to raise_error
+ expect { data_bag_item.raw_data = { "id" => ".bozo" } }.to raise_error(ArgumentError)
end
it "should raise an exception if the id contains anything but alphanum/-/_" do
diff --git a/spec/unit/data_bag_spec.rb b/spec/unit/data_bag_spec.rb
index 2a7ddddd5b..891f9c6616 100644
--- a/spec/unit/data_bag_spec.rb
+++ b/spec/unit/data_bag_spec.rb
@@ -49,7 +49,7 @@ describe Chef::DataBag do
expect { @data_bag.name({}) }.to raise_error(ArgumentError)
end
- [ ".", "-", "_", "1"].each do |char|
+ ["-", "_", "1"].each do |char|
it "should allow a '#{char}' character in the data bag name" do
expect(@data_bag.name("clown#{char}clown")).to eq("clown#{char}clown")
end