summaryrefslogtreecommitdiff
path: root/spec/unit/resource_collection
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-05 15:00:00 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-05 15:00:00 -0800
commit686113531d23f30e9973d659c456ae33eb9cff1f (patch)
treef225de7251a8b49b8d183dd168bab0a0addbe23f /spec/unit/resource_collection
parentd1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff)
downloadchef-686113531d23f30e9973d659c456ae33eb9cff1f.tar.gz
autofixing whitespace cops
4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
Diffstat (limited to 'spec/unit/resource_collection')
-rw-r--r--spec/unit/resource_collection/resource_list_spec.rb8
-rw-r--r--spec/unit/resource_collection/resource_set_spec.rb12
-rw-r--r--spec/unit/resource_collection/stepable_iterator_spec.rb8
3 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/resource_collection/resource_list_spec.rb b/spec/unit/resource_collection/resource_list_spec.rb
index 9863747bf4..dabb8f037d 100644
--- a/spec/unit/resource_collection/resource_list_spec.rb
+++ b/spec/unit/resource_collection/resource_list_spec.rb
@@ -24,7 +24,7 @@ describe Chef::ResourceCollection::ResourceList do
let(:second_resource) { Chef::Resource::ZenMaster.new("hattori") }
def insert_resource(res)
- expect{ resource_list.insert(res) }.not_to raise_error
+ expect { resource_list.insert(res) }.not_to raise_error
end
describe "initialize" do
@@ -47,14 +47,14 @@ describe Chef::ResourceCollection::ResourceList do
end
it "should raise error when trying to install something other than Chef::Resource" do
- expect{ resource_list.insert("not a resource") }.to raise_error(ArgumentError)
+ expect { resource_list.insert("not a resource") }.to raise_error(ArgumentError)
end
end
describe "accessors" do
it "should be able to insert with []=" do
- expect{ resource_list[0] = resource }.not_to raise_error
- expect{ resource_list[1] = second_resource }.not_to raise_error
+ expect { resource_list[0] = resource }.not_to raise_error
+ expect { resource_list[1] = second_resource }.not_to raise_error
expect(resource_list[0]).to be(resource)
expect(resource_list[1]).to be(second_resource)
end
diff --git a/spec/unit/resource_collection/resource_set_spec.rb b/spec/unit/resource_collection/resource_set_spec.rb
index cacd555b4b..2f8ba0e1aa 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)
@@ -192,7 +192,7 @@ describe Chef::ResourceCollection::ResourceSet do
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
diff --git a/spec/unit/resource_collection/stepable_iterator_spec.rb b/spec/unit/resource_collection/stepable_iterator_spec.rb
index 61d374ab0b..6354b1b7fb 100644
--- a/spec/unit/resource_collection/stepable_iterator_spec.rb
+++ b/spec/unit/resource_collection/stepable_iterator_spec.rb
@@ -26,7 +26,7 @@ describe Chef::ResourceCollection::StepableIterator do
describe "doing basic iteration" do
before do
- @simple_collection = [1,2,3,4]
+ @simple_collection = [1, 2, 3, 4]
@iterator = CRSI.for_collection(@simple_collection)
end
@@ -57,7 +57,7 @@ describe Chef::ResourceCollection::StepableIterator do
@iterator.each_with_index do |element, index|
collected[index] = element
end
- expect(collected).to eq({0=>1, 1=>2, 2=>3, 3=>4})
+ expect(collected).to eq({ 0 => 1, 1 => 2, 2 => 3, 3 => 4 })
end
end
@@ -117,7 +117,7 @@ describe Chef::ResourceCollection::StepableIterator do
it "doesn't step if there are no more steps" do
expect(@iterator.step).to eq(3)
- expect {@iterator.step}.not_to raise_error
+ expect { @iterator.step }.not_to raise_error
expect(@iterator.step).to be_nil
end
@@ -131,7 +131,7 @@ describe Chef::ResourceCollection::StepableIterator do
end
it "should work correctly when elements are added to the collection during iteration" do
- @collection.insert(2, lambda { @snitch_var = 815})
+ @collection.insert(2, lambda { @snitch_var = 815 })
@collection.insert(3, lambda { @iterator.pause })
@iterator.resume
expect(@snitch_var).to eq(815)