diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-05 15:00:00 -0800 |
commit | 686113531d23f30e9973d659c456ae33eb9cff1f (patch) | |
tree | f225de7251a8b49b8d183dd168bab0a0addbe23f /spec/unit/role_spec.rb | |
parent | d1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff) | |
download | chef-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/role_spec.rb')
-rw-r--r-- | spec/unit/role_spec.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/unit/role_spec.rb b/spec/unit/role_spec.rb index 6cdeaced47..1ff76d7207 100644 --- a/spec/unit/role_spec.rb +++ b/spec/unit/role_spec.rb @@ -44,7 +44,6 @@ describe Chef::Role do @role.run_list(%w{ nginx recipe[ree] role[base]}) end - it "returns the run list" do expect(@role.run_list).to eq(%w{ nginx recipe[ree] role[base]}) end @@ -79,12 +78,11 @@ describe Chef::Role do it "env_run_lists can only be set with _default run list in it" do long_exception_name = Chef::Exceptions::InvalidEnvironmentRunListSpecification - expect {@role.env_run_lists({})}.to raise_error(long_exception_name) + expect { @role.env_run_lists({}) }.to raise_error(long_exception_name) end end - describe "using the old #recipes API" do it "should let you set the recipe array" do expect(@role.recipes([ "one", "two" ])).to eq([ "one", "two" ]) @@ -104,8 +102,6 @@ describe Chef::Role do end - - describe "default_attributes" do it "should let you set the default attributes hash explicitly" do expect(@role.default_attributes({ :one => "two" })).to eq({ :one => "two" }) @@ -249,7 +245,7 @@ describe Chef::Role do end end - ROLE_DSL=<<-EOR + ROLE_DSL = <<-EOR name "ceiling_cat" description "like Aliens, but furry" EOR @@ -293,20 +289,20 @@ EOR it "should raise an exception if the file does not exist" do expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/meme.rb"]) expect(File).not_to receive(:exists?) - expect {@role.class.from_disk("lolcat")}.to raise_error(Chef::Exceptions::RoleNotFound) + expect { @role.class.from_disk("lolcat") }.to raise_error(Chef::Exceptions::RoleNotFound) end it "should raise an exception if two files exist with the same name" do expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes/lolcat.rb", "#{Chef::Config[:role_path]}/lolcat.rb"]) expect(File).not_to receive(:exists?) - expect {@role.class.from_disk("lolcat")}.to raise_error(Chef::Exceptions::DuplicateRole) + expect { @role.class.from_disk("lolcat") }.to raise_error(Chef::Exceptions::DuplicateRole) end it "should not raise an exception if two files exist with a similar name" do expect(Dir).to receive(:glob).and_return(["#{Chef::Config[:role_path]}/memes/lolcat.rb", "#{Chef::Config[:role_path]}/super_lolcat.rb"]) expect(File).to receive(:exists?).with("#{Chef::Config[:role_path]}/memes/lolcat.rb").and_return(true) allow_any_instance_of(Chef::Role).to receive(:from_file).with("#{Chef::Config[:role_path]}/memes/lolcat.rb") - expect{ @role.class.from_disk("lolcat") }.not_to raise_error + expect { @role.class.from_disk("lolcat") }.not_to raise_error end end @@ -355,7 +351,7 @@ EOR it "should raise an exception if the file does not exist" do expect(Dir).to receive(:glob).with(File.join("/path1", "**", "**")).exactly(1).times.and_return([]) expect(Dir).to receive(:glob).with(File.join("/path/path2", "**", "**")).exactly(1).times.and_return([]) - expect {@role.class.from_disk("lolcat")}.to raise_error(Chef::Exceptions::RoleNotFound) + expect { @role.class.from_disk("lolcat") }.to raise_error(Chef::Exceptions::RoleNotFound) end end |