summaryrefslogtreecommitdiff
path: root/spec/unit/resource_collection/resource_set_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource_collection/resource_set_spec.rb')
-rw-r--r--spec/unit/resource_collection/resource_set_spec.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/unit/resource_collection/resource_set_spec.rb b/spec/unit/resource_collection/resource_set_spec.rb
index cacd555b4b..5c6ca9da63 100644
--- a/spec/unit/resource_collection/resource_set_spec.rb
+++ b/spec/unit/resource_collection/resource_set_spec.rb
@@ -78,13 +78,13 @@ describe Chef::ResourceCollection::ResourceSet do
it "should find a resource by type symbol and array of names" do
collection.insert_as(zen_master)
collection.insert_as(zen_master2)
- check_by_names(collection.find(:zen_master => [zen_master_name,zen_master2_name]), zen_master_name, zen_master2_name)
+ check_by_names(collection.find(:zen_master => [zen_master_name, zen_master2_name]), zen_master_name, zen_master2_name)
end
it "should find a resource by type symbol and array of names with custom names" do
collection.insert_as(zen_master, :zzz, "name1")
collection.insert_as(zen_master2, :zzz, "name2")
- check_by_names(collection.find( :zzz => ["name1","name2"]), zen_master_name, zen_master2_name)
+ check_by_names(collection.find( :zzz => ["name1", "name2"]), zen_master_name, zen_master2_name)
end
it "should find resources of multiple kinds (:zen_master => a, :zen_follower => b)" do
@@ -98,7 +98,7 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master, :zzz, "name1")
collection.insert_as(zen_master2, :zzz, "name2")
collection.insert_as(zen_follower, :yyy, "name3")
- check_by_names(collection.find(:zzz => ["name1","name2"], :yyy => ["name3"]),
+ check_by_names(collection.find(:zzz => ["name1", "name2"], :yyy => ["name3"]),
zen_master_name, zen_follower_name, zen_master2_name)
end
@@ -138,13 +138,13 @@ describe Chef::ResourceCollection::ResourceSet do
collection.insert_as(zen_master2, :zzz, "name2")
collection.insert_as(zen_follower, :yyy, "name3")
check_by_names(collection.find("zzz[name1,name2]", "yyy[name3]"),
- zen_master_name, zen_follower_name,zen_master2_name)
+ zen_master_name, zen_follower_name, zen_master2_name)
end
it "should only keep the last copy when multiple instances of a Resource are inserted" do
collection.insert_as(zen_master)
expect(collection.find("zen_master[#{zen_master_name}]")).to eq(zen_master)
- new_zm =zen_master.dup
+ new_zm = zen_master.dup
new_zm.retries = 10
expect(new_zm).to_not eq(zen_master)
collection.insert_as(new_zm)
@@ -186,14 +186,12 @@ describe Chef::ResourceCollection::ResourceSet do
expect { collection.validate_lookup_spec!(Object.new) }.to \
raise_error(Chef::Exceptions::InvalidResourceSpecification)
end
-
end
def check_by_names(results, *names)
expect(results.size).to eq(names.size)
names.each do |name|
- expect(results.detect{|r| r.name == name}).to_not eq(nil)
+ expect(results.detect { |r| r.name == name }).to_not eq(nil)
end
end
-
end