summaryrefslogtreecommitdiff
path: root/spec/functional/util
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functional/util')
-rw-r--r--spec/functional/util/path_helper_spec.rb8
-rw-r--r--spec/functional/util/powershell/cmdlet_spec.rb32
2 files changed, 20 insertions, 20 deletions
diff --git a/spec/functional/util/path_helper_spec.rb b/spec/functional/util/path_helper_spec.rb
index 0321702bb8..edd9f2e224 100644
--- a/spec/functional/util/path_helper_spec.rb
+++ b/spec/functional/util/path_helper_spec.rb
@@ -14,9 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'tmpdir'
-require 'chef/util/path_helper'
-require 'spec_helper'
+require "tmpdir"
+require "chef/util/path_helper"
+require "spec_helper"
describe Chef::Util::PathHelper, "escape_glob" do
PathHelper = Chef::Util::PathHelper
@@ -27,7 +27,7 @@ describe Chef::Util::PathHelper, "escape_glob" do
# add some files
files = ["some.rb", "file.txt", "names.csv"]
files.each do |file|
- File.new(File.join(dir, file), 'w').close
+ File.new(File.join(dir, file), "w").close
end
pattern = File.join(PathHelper.escape_glob(dir), "*")
diff --git a/spec/functional/util/powershell/cmdlet_spec.rb b/spec/functional/util/powershell/cmdlet_spec.rb
index 201fb95af8..fe9438f467 100644
--- a/spec/functional/util/powershell/cmdlet_spec.rb
+++ b/spec/functional/util/powershell/cmdlet_spec.rb
@@ -16,22 +16,22 @@
# limitations under the License.
#
-require 'chef/json_compat'
-require File.expand_path('../../../../spec_helper', __FILE__)
+require "chef/json_compat"
+require File.expand_path("../../../../spec_helper", __FILE__)
describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
before(:all) do
ohai = Ohai::System.new
ohai.load_plugins
- ohai.run_plugins(true, ['platform', 'kernel'])
+ ohai.run_plugins(true, ["platform", "kernel"])
@node = Chef::Node.new
@node.consume_external_attrs(ohai.data, {})
end
let(:cmd_output_format) { :text }
- let(:simple_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, 'get-childitem', cmd_output_format, {:depth => 2}) }
- let(:invalid_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, 'get-idontexist', cmd_output_format) }
- let(:cmdlet_get_item_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, 'get-item', cmd_output_format, {:depth => 2}) }
- let(:cmdlet_alias_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, 'alias', cmd_output_format, {:depth => 2}) }
+ let(:simple_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "get-childitem", cmd_output_format, {:depth => 2}) }
+ let(:invalid_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "get-idontexist", cmd_output_format) }
+ let(:cmdlet_get_item_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, "get-item", cmd_output_format, {:depth => 2}) }
+ let(:cmdlet_alias_requires_switch_or_argument) { Chef::Util::Powershell::Cmdlet.new(@node, "alias", cmd_output_format, {:depth => 2}) }
let(:etc_directory) { "#{ENV['systemroot']}\\system32\\drivers\\etc" }
let(:architecture_cmdlet) { Chef::Util::Powershell::Cmdlet.new(@node, "$env:PROCESSOR_ARCHITECTURE")}
@@ -49,9 +49,9 @@ describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
end
it "executes a 64-bit command on a 64-bit OS, 32-bit otherwise" do
- os_arch = ENV['PROCESSOR_ARCHITEW6432']
+ os_arch = ENV["PROCESSOR_ARCHITEW6432"]
if os_arch.nil?
- os_arch = ENV['PROCESSOR_ARCHITECTURE']
+ os_arch = ENV["PROCESSOR_ARCHITECTURE"]
end
result = architecture_cmdlet.run
@@ -61,17 +61,17 @@ describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
end
it "passes command line switches to the command" do
- result = cmdlet_alias_requires_switch_or_argument.run({:name => 'ls'})
+ result = cmdlet_alias_requires_switch_or_argument.run({:name => "ls"})
expect(result.succeeded?).to eq(true)
end
it "passes command line arguments to the command" do
- result = cmdlet_alias_requires_switch_or_argument.run({},{},'ls')
+ result = cmdlet_alias_requires_switch_or_argument.run({},{},"ls")
expect(result.succeeded?).to eq(true)
end
it "passes command line arguments and switches to the command" do
- result = cmdlet_get_item_requires_switch_or_argument.run({:path => etc_directory},{},' | select-object -property fullname | format-table -hidetableheaders')
+ result = cmdlet_get_item_requires_switch_or_argument.run({:path => etc_directory},{}," | select-object -property fullname | format-table -hidetableheaders")
expect(result.succeeded?).to eq(true)
returned_directory = result.return_value
returned_directory.strip!
@@ -79,7 +79,7 @@ describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
end
it "passes execution options to the command" do
- result = cmdlet_get_item_requires_switch_or_argument.run({},{:cwd => etc_directory},'. | select-object -property fullname | format-table -hidetableheaders')
+ result = cmdlet_get_item_requires_switch_or_argument.run({},{:cwd => etc_directory},". | select-object -property fullname | format-table -hidetableheaders")
expect(result.succeeded?).to eq(true)
returned_directory = result.return_value
returned_directory.strip!
@@ -89,7 +89,7 @@ describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
context "when returning json" do
let(:cmd_output_format) { :json }
it "returns json format data" do
- result = cmdlet_alias_requires_switch_or_argument.run({},{},'ls')
+ result = cmdlet_alias_requires_switch_or_argument.run({},{},"ls")
expect(result.succeeded?).to eq(true)
expect(lambda{Chef::JSONCompat.parse(result.return_value)}).not_to raise_error
end
@@ -98,10 +98,10 @@ describe Chef::Util::Powershell::Cmdlet, :windows_powershell_dsc_only do
context "when returning Ruby objects" do
let(:cmd_output_format) { :object }
it "returns object format data" do
- result = simple_cmdlet.run({},{:cwd => etc_directory}, 'hosts')
+ result = simple_cmdlet.run({},{:cwd => etc_directory}, "hosts")
expect(result.succeeded?).to eq(true)
data = result.return_value
- expect(data['Name']).to eq('hosts')
+ expect(data["Name"]).to eq("hosts")
end
end