summaryrefslogtreecommitdiff
path: root/spec/unit/util/powershell/cmdlet_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/util/powershell/cmdlet_spec.rb')
-rw-r--r--spec/unit/util/powershell/cmdlet_spec.rb44
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