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/environment_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/environment_spec.rb')
-rw-r--r-- | spec/unit/environment_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index ef8abc3f15..f4026c7e78 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -167,7 +167,7 @@ describe Chef::Environment do before(:each) do @environment.name("spec") @environment.description("Where we run the spec tests") - @environment.cookbook_versions({:apt => "= 1.2.3"}) + @environment.cookbook_versions({ :apt => "= 1.2.3" }) @hash = @environment.to_hash end @@ -190,7 +190,7 @@ describe Chef::Environment do before(:each) do @environment.name("spec") @environment.description("Where we run the spec tests") - @environment.cookbook_versions({:apt => "= 1.2.3"}) + @environment.cookbook_versions({ :apt => "= 1.2.3" }) @json = @environment.to_json end @@ -329,13 +329,13 @@ describe Chef::Environment do # NOTE: I'm only choosing this (admittedly weird) structure for the hash b/c the better more obvious # one, i.e, {:cookbook_version_constraints => {COOKBOOK_NAME => CONSTRAINT}} is difficult to implement # the way merb does params - params = {:name=>"superbowl", :cookbook_version => {"0" => "apache2 ~> 1.0.0", "1" => "nginx < 2.0.0"}} + params = { :name => "superbowl", :cookbook_version => { "0" => "apache2 ~> 1.0.0", "1" => "nginx < 2.0.0" } } @environment.update_from_params(params) - expect(@environment.cookbook_versions).to eq({"apache2" => "~> 1.0.0", "nginx" => "< 2.0.0"}) + expect(@environment.cookbook_versions).to eq({ "apache2" => "~> 1.0.0", "nginx" => "< 2.0.0" }) end it "validates the cookbook constraints" do - params = {:cookbook_version => {"0" => "apache2 >>> 1.0.0"}} + params = { :cookbook_version => { "0" => "apache2 >>> 1.0.0" } } expect(@environment.update_from_params(params)).to be_falsey err_msg = @environment.invalid_fields[:cookbook_version]["0"] expect(err_msg).to eq("apache2 >>> 1.0.0 is not a valid cookbook constraint") @@ -353,12 +353,12 @@ describe Chef::Environment do it "updates default attributes from a JSON string in params[:attributes]" do @environment.update_from_params(:name => "fuuu", :default_attributes => %q|{"fuuu":"RAGE"}|) - expect(@environment.default_attributes).to eq({"fuuu" => "RAGE"}) + expect(@environment.default_attributes).to eq({ "fuuu" => "RAGE" }) end it "updates override attributes from a JSON string in params[:attributes]" do @environment.update_from_params(:name => "fuuu", :override_attributes => %q|{"foo":"override"}|) - expect(@environment.override_attributes).to eq({"foo" => "override"}) + expect(@environment.override_attributes).to eq({ "foo" => "override" }) end end @@ -405,7 +405,7 @@ describe Chef::Environment do expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], "foo.json")).and_return(false) expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], "foo.rb")).exactly(2).times.and_return(true) expect(File).to receive(:readable?).with(File.join(Chef::Config[:environment_path], "foo.rb")).and_return(true) - role_dsl="name \"foo\"\ndescription \"desc\"\n" + role_dsl = "name \"foo\"\ndescription \"desc\"\n" expect(IO).to receive(:read).with(File.join(Chef::Config[:environment_path], "foo.rb")).and_return(role_dsl) Chef::Environment.load("foo") end @@ -438,7 +438,7 @@ describe Chef::Environment do expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], "foo.json")).and_return(false) expect(File).to receive(:exists?).with(File.join(Chef::Config[:environment_path], "foo.rb")).exactly(2).times.and_return(true) expect(File).to receive(:readable?).with(File.join(Chef::Config[:environment_path], "foo.rb")).and_return(true) - role_dsl="name \"foo\"\ndescription \"desc\"\n" + role_dsl = "name \"foo\"\ndescription \"desc\"\n" expect(IO).to receive(:read).with(File.join(Chef::Config[:environment_path], "foo.rb")).and_return(role_dsl) environment = Chef::Environment.load("foo") |