summaryrefslogtreecommitdiff
path: root/spec/unit/data_bag_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/data_bag_spec.rb')
-rw-r--r--spec/unit/data_bag_spec.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/unit/data_bag_spec.rb b/spec/unit/data_bag_spec.rb
index c2bcff4378..05c55cba96 100644
--- a/spec/unit/data_bag_spec.rb
+++ b/spec/unit/data_bag_spec.rb
@@ -77,7 +77,6 @@ describe Chef::DataBag do
let(:jsonable) { @data_bag }
end
end
-
end
describe "when saving" do
@@ -110,7 +109,6 @@ describe Chef::DataBag do
@data_bag.save
end
end
-
end
describe "when loading" do
describe "from an API call" do
@@ -127,9 +125,9 @@ describe Chef::DataBag do
it "should return the data bag" do
allow(Chef::ServerAPI).to receive(:new).and_return(@http_client)
- expect(@http_client).to receive(:get).with("data/foo").and_return({"bar" => "https://myserver.example.com/data/foo/bar"})
+ expect(@http_client).to receive(:get).with("data/foo").and_return({ "bar" => "https://myserver.example.com/data/foo/bar" })
data_bag = Chef::DataBag.load("foo")
- expect(data_bag).to eq({"bar" => "https://myserver.example.com/data/foo/bar"})
+ expect(data_bag).to eq({ "bar" => "https://myserver.example.com/data/foo/bar" })
end
end
@@ -180,7 +178,7 @@ describe Chef::DataBag do
expect(IO).to receive(:read).with(File.join(@paths.first, "foo/bar.json")).and_return('{"id": "bar", "name": "Bob Bar" }')
expect(IO).to receive(:read).with(File.join(@paths.first, "foo/baz.json")).and_return('{"id": "baz", "name": "John Baz" }')
data_bag = Chef::DataBag.load("foo")
- expect(data_bag).to eq({ "bar" => { "id" => "bar", "name" => "Bob Bar" }, "baz" => { "id" => "baz", "name" => "John Baz" }})
+ expect(data_bag).to eq({ "bar" => { "id" => "bar", "name" => "Bob Bar" }, "baz" => { "id" => "baz", "name" => "John Baz" } })
end
it "should raise if data bag has items with similar names but different content" do
@@ -208,7 +206,7 @@ describe Chef::DataBag do
expect(IO).to receive(:read).with(File.join(path, "foo/baz.json")).and_return(item_with_same_content)
end
data_bag = Chef::DataBag.load("foo")
- test_data_bag = { "bar" => { "id" => "bar", "name" => "Bob Bar"} }
+ test_data_bag = { "bar" => { "id" => "bar", "name" => "Bob Bar" } }
expect(data_bag).to eq(test_data_bag)
end
@@ -222,7 +220,7 @@ describe Chef::DataBag do
expect(IO).to receive(:read).with(File.join(path, "foo/baz.json")).and_return(test_uniq_item)
end
data_bag = Chef::DataBag.load("foo")
- test_data_bag = { "bar" => { "id" => "bar", "name" => "Bob Bar"} }
+ test_data_bag = { "bar" => { "id" => "bar", "name" => "Bob Bar" } }
@paths.each_with_index do |path, index|
test_data_bag["baz_#{index}"] = { "id" => "baz_#{index}", "name" => "John Baz", "path" => path }
end
@@ -245,7 +243,6 @@ describe Chef::DataBag do
Chef::DataBag.load("foo")
}.to raise_error Chef::Exceptions::InvalidDataBagPath, "Data bag path '/var/chef/data_bags' is invalid"
end
-
end
describe "data bag with string path" do
@@ -256,5 +253,4 @@ describe Chef::DataBag do
it_should_behave_like "data bag in solo mode", ["/var/chef/data_bags", "/var/chef/data_bags_2"]
end
end
-
end