diff options
author | Thom May <thom@chef.io> | 2016-01-13 09:50:23 +0000 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-01-13 09:50:23 +0000 |
commit | 0e4b96f3414ef7d9599c70f2661bea8c2037aad5 (patch) | |
tree | 5e9b9424ad5b7e320f187ebd020a216bbdb5bf68 /spec/unit/util/powershell/cmdlet_spec.rb | |
parent | 556e5f2d78b5c6de2f34d8dd655ee515ff317296 (diff) | |
download | chef-tm/string_literals.tar.gz |
Use double quotes by defaulttm/string_literals
This is an entirely mechanically generated (rubocop -a) change, to go
along with chef/chefstyle#5 . We should pick something and use it
consistently, and my opinion is that double quotes are the appropriate
thing.
Diffstat (limited to 'spec/unit/util/powershell/cmdlet_spec.rb')
-rw-r--r-- | spec/unit/util/powershell/cmdlet_spec.rb | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/spec/unit/util/powershell/cmdlet_spec.rb b/spec/unit/util/powershell/cmdlet_spec.rb index 5ddf9282c4..d2a7960db2 100644 --- a/spec/unit/util/powershell/cmdlet_spec.rb +++ b/spec/unit/util/powershell/cmdlet_spec.rb @@ -16,25 +16,25 @@ # limitations under the License. # -require 'chef' -require 'chef/util/powershell/cmdlet' +require "chef" +require "chef/util/powershell/cmdlet" describe Chef::Util::Powershell::Cmdlet do before (:all) do @node = Chef::Node.new - @cmdlet = Chef::Util::Powershell::Cmdlet.new(@node, 'Some-Commandlet') + @cmdlet = Chef::Util::Powershell::Cmdlet.new(@node, "Some-Commandlet") end describe '#validate_switch_name!' do - it 'should not raise an error if a name contains all upper case letters' do + it "should not raise an error if a name contains all upper case letters" do @cmdlet.send(:validate_switch_name!, "HELLO") end - it 'should not raise an error if the name contains all lower case letters' do + it "should not raise an error if the name contains all lower case letters" do @cmdlet.send(:validate_switch_name!, "hello") end - it 'should not raise an error if no special characters are used except _' do + it "should not raise an error if no special characters are used except _" do @cmdlet.send(:validate_switch_name!, "hello_world") end @@ -55,51 +55,51 @@ describe Chef::Util::Powershell::Cmdlet do end end - it 'does not do anything to a string without special characters' do - expect(@cmdlet.send(:escape_parameter_value, 'stuff')).to eql('stuff') + it "does not do anything to a string without special characters" do + expect(@cmdlet.send(:escape_parameter_value, "stuff")).to eql("stuff") end end describe '#escape_string_parameter_value' do it "surrounds a string with ''" do - expect(@cmdlet.send(:escape_string_parameter_value, 'stuff')).to eql("'stuff'") + expect(@cmdlet.send(:escape_string_parameter_value, "stuff")).to eql("'stuff'") end end describe '#command_switches_string' do - it 'raises an ArgumentError if the key is not a symbol' do + it "raises an ArgumentError if the key is not a symbol" do expect { - @cmdlet.send(:command_switches_string, {'foo' => 'bar'}) + @cmdlet.send(:command_switches_string, {"foo" => "bar"}) }.to raise_error(ArgumentError) end - it 'does not allow invalid switch names' do + it "does not allow invalid switch names" do expect { - @cmdlet.send(:command_switches_string, {:foo! => 'bar'}) + @cmdlet.send(:command_switches_string, {:foo! => "bar"}) }.to raise_error(ArgumentError) end - it 'ignores switches with a false value' do - expect(@cmdlet.send(:command_switches_string, {foo: false})).to eql('') + it "ignores switches with a false value" do + expect(@cmdlet.send(:command_switches_string, {foo: false})).to eql("") end - it 'should correctly handle a value type of string' do - expect(@cmdlet.send(:command_switches_string, {foo: 'bar'})).to eql("-foo 'bar'") + it "should correctly handle a value type of string" do + expect(@cmdlet.send(:command_switches_string, {foo: "bar"})).to eql("-foo 'bar'") end - it 'should correctly handle a value type of string even when it is 0 length' do - expect(@cmdlet.send(:command_switches_string, {foo: ''})).to eql("-foo ''") + it "should correctly handle a value type of string even when it is 0 length" do + expect(@cmdlet.send(:command_switches_string, {foo: ""})).to eql("-foo ''") end - it 'should not quote integers' do + it "should not quote integers" do expect(@cmdlet.send(:command_switches_string, {foo: 1})).to eql("-foo 1") end - it 'should not quote floats' do + it "should not quote floats" do expect(@cmdlet.send(:command_switches_string, {foo: 1.0})).to eql("-foo 1.0") end - it 'has just the switch when the value is true' do + it "has just the switch when the value is true" do expect(@cmdlet.send(:command_switches_string, {foo: true})).to eql("-foo") end end |