summaryrefslogtreecommitdiff
path: root/spec/unit/provider
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider')
-rw-r--r--spec/unit/provider/group/dscl_spec.rb6
-rw-r--r--spec/unit/provider/group/groupadd_spec.rb4
-rw-r--r--spec/unit/provider/group/pw_spec.rb8
-rw-r--r--spec/unit/provider/group/usermod_spec.rb4
-rw-r--r--spec/unit/provider/group/windows_spec.rb2
-rw-r--r--spec/unit/provider/group_spec.rb2
-rw-r--r--spec/unit/provider/mount/mount_spec.rb2
-rw-r--r--spec/unit/provider/mount/solaris_spec.rb2
-rw-r--r--spec/unit/provider/package/chocolatey_spec.rb40
-rw-r--r--spec/unit/provider/package/yum_spec.rb42
-rw-r--r--spec/unit/provider/package/zypper_spec.rb4
-rw-r--r--spec/unit/provider/package_spec.rb24
-rw-r--r--spec/unit/provider/service/arch_service_spec.rb2
-rw-r--r--spec/unit/provider/service/freebsd_service_spec.rb10
-rw-r--r--spec/unit/provider/service/macosx_spec.rb2
-rw-r--r--spec/unit/provider/service/openbsd_service_spec.rb8
-rw-r--r--spec/unit/provider/service/redhat_spec.rb4
-rw-r--r--spec/unit/provider/user_spec.rb4
18 files changed, 85 insertions, 85 deletions
diff --git a/spec/unit/provider/group/dscl_spec.rb b/spec/unit/provider/group/dscl_spec.rb
index e060e4af10..bc69d7580e 100644
--- a/spec/unit/provider/group/dscl_spec.rb
+++ b/spec/unit/provider/group/dscl_spec.rb
@@ -184,7 +184,7 @@ describe Chef::Provider::Group::Dscl do
before do
allow(@new_resource).to receive(:members).and_return([])
allow(@new_resource).to receive(:append).and_return(false)
- allow(@current_resource).to receive(:members).and_return(%w(all your base))
+ allow(@current_resource).to receive(:members).and_return(%w{all your base})
end
it "should log an appropriate message" do
@@ -201,7 +201,7 @@ describe Chef::Provider::Group::Dscl do
describe "with supplied members in the new resource" do
before do
- @new_resource.members(%w(all your base))
+ @new_resource.members(%w{all your base})
@current_resource.members([])
end
@@ -326,6 +326,6 @@ EOF
end
it "should parse members properly" do
allow(File).to receive(:exists?).and_return(true)
- expect(@current_resource.members).to eq(%w(waka bar))
+ expect(@current_resource.members).to eq(%w{waka bar})
end
end
diff --git a/spec/unit/provider/group/groupadd_spec.rb b/spec/unit/provider/group/groupadd_spec.rb
index e8b47621c4..87ab3c3493 100644
--- a/spec/unit/provider/group/groupadd_spec.rb
+++ b/spec/unit/provider/group/groupadd_spec.rb
@@ -25,12 +25,12 @@ describe Chef::Provider::Group::Groupadd, "set_options" do
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Group.new("aj")
@new_resource.gid(50)
- @new_resource.members(%w(root aj))
+ @new_resource.members(%w{root aj})
@new_resource.system false
@new_resource.non_unique false
@current_resource = Chef::Resource::Group.new("aj")
@current_resource.gid(50)
- @current_resource.members(%w(root aj))
+ @current_resource.members(%w{root aj})
@current_resource.system false
@current_resource.non_unique false
@provider = Chef::Provider::Group::Groupadd.new(@new_resource, @run_context)
diff --git a/spec/unit/provider/group/pw_spec.rb b/spec/unit/provider/group/pw_spec.rb
index 250946fd1a..97ffcb3c31 100644
--- a/spec/unit/provider/group/pw_spec.rb
+++ b/spec/unit/provider/group/pw_spec.rb
@@ -26,11 +26,11 @@ describe Chef::Provider::Group::Pw do
@new_resource = Chef::Resource::Group.new("wheel")
@new_resource.gid 50
- @new_resource.members %w(root aj)
+ @new_resource.members %w{root aj}
@current_resource = Chef::Resource::Group.new("aj")
@current_resource.gid 50
- @current_resource.members %w(root aj)
+ @current_resource.members %w{root aj}
@provider = Chef::Provider::Group::Pw.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
end
@@ -89,7 +89,7 @@ describe Chef::Provider::Group::Pw do
describe "with an empty members array in the new resource and existing members in the current resource" do
before do
allow(@new_resource).to receive(:members).and_return([])
- allow(@current_resource).to receive(:members).and_return(%w(all your base))
+ allow(@current_resource).to receive(:members).and_return(%w{all your base})
end
it "should log an appropriate message" do
@@ -104,7 +104,7 @@ describe Chef::Provider::Group::Pw do
describe "with supplied members array in the new resource and an empty members array in the current resource" do
before do
- allow(@new_resource).to receive(:members).and_return(%w(all your base))
+ allow(@new_resource).to receive(:members).and_return(%w{all your base})
allow(@current_resource).to receive(:members).and_return([])
end
diff --git a/spec/unit/provider/group/usermod_spec.rb b/spec/unit/provider/group/usermod_spec.rb
index 5ab5d2bce0..7bd45c4f1b 100644
--- a/spec/unit/provider/group/usermod_spec.rb
+++ b/spec/unit/provider/group/usermod_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Provider::Group::Usermod do
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
@new_resource = Chef::Resource::Group.new("wheel")
- @new_resource.members %w(all your base)
+ @new_resource.members %w{all your base}
@new_resource.excluded_members [ ]
@provider = Chef::Provider::Group::Usermod.new(@new_resource, @run_context)
allow(@provider).to receive(:run_command)
@@ -56,7 +56,7 @@ describe Chef::Provider::Group::Usermod do
}
before do
- allow(@new_resource).to receive(:members).and_return(%w(all your base))
+ allow(@new_resource).to receive(:members).and_return(%w{all your base})
allow(File).to receive(:exists?).and_return(true)
end
diff --git a/spec/unit/provider/group/windows_spec.rb b/spec/unit/provider/group/windows_spec.rb
index 7ff58848fa..c424e35e0e 100644
--- a/spec/unit/provider/group/windows_spec.rb
+++ b/spec/unit/provider/group/windows_spec.rb
@@ -50,7 +50,7 @@ describe Chef::Provider::Group::Windows do
before do
@new_resource.members([ "us" ])
@current_resource = Chef::Resource::Group.new("staff")
- @current_resource.members %w(all your base)
+ @current_resource.members %w{all your base}
allow(Chef::Util::Windows::NetGroup).to receive(:new).and_return(@net_group)
allow(@net_group).to receive(:local_add_members)
diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb
index ed0537adfe..f056114d89 100644
--- a/spec/unit/provider/group_spec.rb
+++ b/spec/unit/provider/group_spec.rb
@@ -39,7 +39,7 @@ describe Chef::Provider::User do
@pw_group = double("Struct::Group",
:name => "wheel",
:gid => 20,
- :mem => %w(root aj),
+ :mem => %w{root aj},
)
allow(Etc).to receive(:getgrnam).with("wheel").and_return(@pw_group)
end
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index 4e636fba5f..52be15b2a8 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -107,7 +107,7 @@ describe Chef::Provider::Mount::Mount do
expect { @provider.load_current_resource();@provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
- %w(tmpfs fuse cgroup).each do |fstype|
+ %w{tmpfs fuse cgroup}.each do |fstype|
it "does not expect the device to exist for #{fstype}" do
@new_resource.fstype(fstype)
@new_resource.device("whatever")
diff --git a/spec/unit/provider/mount/solaris_spec.rb b/spec/unit/provider/mount/solaris_spec.rb
index 3d5ce53619..51ace83470 100644
--- a/spec/unit/provider/mount/solaris_spec.rb
+++ b/spec/unit/provider/mount/solaris_spec.rb
@@ -316,7 +316,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
end
it "should set the options field on the current_resource" do
- expect(provider.current_resource.options).to eql(%w(rw soft))
+ expect(provider.current_resource.options).to eql(%w{rw soft})
end
it "should set the pass field on the current_resource" do
diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb
index 34cfec2c05..a347aa7ebd 100644
--- a/spec/unit/provider/package/chocolatey_spec.rb
+++ b/spec/unit/provider/package/chocolatey_spec.rb
@@ -95,26 +95,26 @@ munin-node|1.6.1.20130823
end
it "should set the candidate_version correctly when there are two packages to install" do
- allow_remote_list(%w(ConEmu chocolatey))
- new_resource.package_name(%w(ConEmu chocolatey))
+ allow_remote_list(%w{ConEmu chocolatey})
+ new_resource.package_name(%w{ConEmu chocolatey})
expect(provider.candidate_version).to eql(["15.10.25.1", "0.9.9.11"])
end
it "should set the candidate_version correctly when only the first is installable" do
- allow_remote_list(%w(ConEmu vim))
- new_resource.package_name(%w(ConEmu vim))
+ allow_remote_list(%w{ConEmu vim})
+ new_resource.package_name(%w{ConEmu vim})
expect(provider.candidate_version).to eql(["15.10.25.1", nil])
end
it "should set the candidate_version correctly when only the last is installable" do
- allow_remote_list(%w(vim chocolatey))
- new_resource.package_name(%w(vim chocolatey))
+ allow_remote_list(%w{vim chocolatey})
+ new_resource.package_name(%w{vim chocolatey})
expect(provider.candidate_version).to eql([nil, "0.9.9.11"])
end
it "should set the candidate_version correctly when neither are is installable" do
- allow_remote_list(%w(vim ruby))
- new_resource.package_name(%w(vim ruby))
+ allow_remote_list(%w{vim ruby})
+ new_resource.package_name(%w{vim ruby})
expect(provider.candidate_version).to eql([nil, nil])
end
end
@@ -156,25 +156,25 @@ munin-node|1.6.1.20130823
end
it "should set the current_resource.version when there are two packages that are installed" do
- new_resource.package_name(%w(ConEmu chocolatey))
+ new_resource.package_name(%w{ConEmu chocolatey})
provider.load_current_resource
expect(provider.current_resource.version).to eql(["15.10.25.0", "0.9.9.11"])
end
it "should set the current_resource.version correctly when only the first is installed" do
- new_resource.package_name(%w(ConEmu git))
+ new_resource.package_name(%w{ConEmu git})
provider.load_current_resource
expect(provider.current_resource.version).to eql(["15.10.25.0", nil])
end
it "should set the current_resource.version correctly when only the last is installed" do
- new_resource.package_name(%w(git chocolatey))
+ new_resource.package_name(%w{git chocolatey})
provider.load_current_resource
expect(provider.current_resource.version).to eql([nil, "0.9.9.11"])
end
it "should set the current_resource.version correctly when none are installed" do
- new_resource.package_name(%w(git vim))
+ new_resource.package_name(%w{git vim})
provider.load_current_resource
expect(provider.current_resource.version).to eql([nil, nil])
end
@@ -233,8 +233,8 @@ munin-node|1.6.1.20130823
# chocolatey will be pruned by the superclass out of the args to install_package and we
# implicitly test that we correctly pick up new_resource.version[1] instead of
# new_version.resource[0]
- allow_remote_list(%w(chocolatey ConEmu))
- new_resource.package_name(%w(chocolatey ConEmu))
+ allow_remote_list(%w{chocolatey ConEmu})
+ new_resource.package_name(%w{chocolatey ConEmu})
new_resource.version([nil, "15.10.25.1"])
provider.load_current_resource
expect(provider).to receive(:shell_out!).with("#{choco_exe} install -y -version 15.10.25.1 conemu", { :timeout => timeout }).and_return(double)
@@ -253,8 +253,8 @@ munin-node|1.6.1.20130823
end
it "should split up commands when given two packages, one with a version pin" do
- allow_remote_list(%w(ConEmu git))
- new_resource.package_name(%w(ConEmu git))
+ allow_remote_list(%w{ConEmu git})
+ new_resource.package_name(%w{ConEmu git})
new_resource.version(["15.10.25.1", nil])
provider.load_current_resource
expect(provider).to receive(:shell_out!).with("#{choco_exe} install -y -version 15.10.25.1 conemu", { :timeout => timeout }).and_return(double)
@@ -371,8 +371,8 @@ munin-node|1.6.1.20130823
end
it "upgrading multiple packages uses a single command" do
- allow_remote_list(%w(conemu git))
- new_resource.package_name(%w(conemu git))
+ allow_remote_list(%w{conemu git})
+ new_resource.package_name(%w{conemu git})
expect(provider).to receive(:shell_out!).with("#{choco_exe} upgrade -y conemu git", { :timeout => timeout }).and_return(double)
provider.run_action(:upgrade)
expect(new_resource).to be_updated_by_last_action
@@ -441,8 +441,8 @@ munin-node|1.6.1.20130823
it "removes a single package when its the only one installed" do
pending "this is a bug in the superclass"
- allow_remote_list(%w(git conemu))
- new_resource.package_name(%w(git conemu))
+ allow_remote_list(%w{git conemu})
+ new_resource.package_name(%w{git conemu})
provider.load_current_resource
expect(provider).to receive(:shell_out!).with("#{choco_exe} uninstall -y conemu", { :timeout => timeout }).and_return(double)
provider.run_action(:remove)
diff --git a/spec/unit/provider/package/yum_spec.rb b/spec/unit/provider/package/yum_spec.rb
index 2d4bcc6bef..2b3048bc19 100644
--- a/spec/unit/provider/package/yum_spec.rb
+++ b/spec/unit/provider/package/yum_spec.rb
@@ -987,7 +987,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
end
it "tests isalnum good input" do
- %w(a z A Z 0 9).each do |t|
+ %w{a z A Z 0 9}.each do |t|
expect(@rpmutils.isalnum(t)).to eq(true)
end
end
@@ -999,7 +999,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
end
it "tests isalpha good input" do
- %w(a z A Z).each do |t|
+ %w{a z A Z}.each do |t|
expect(@rpmutils.isalpha(t)).to eq(true)
end
end
@@ -1011,7 +1011,7 @@ describe Chef::Provider::Package::Yum::RPMUtils do
end
it "tests isdigit good input" do
- %w(0 9).each do |t|
+ %w{0 9}.each do |t|
expect(@rpmutils.isdigit(t)).to eq(true)
end
end
@@ -1119,8 +1119,8 @@ describe Chef::Provider::Package::Yum::RPMVersion do
"3.3-15.el5" ],
[ "alpha9.8",
"beta9.8" ],
- %w(14jpp
-15jpp),
+ %w{14jpp
+15jpp},
[ "0.9.0-0.6",
"0.9.0-0.7" ],
[ "0:1.9",
@@ -1297,8 +1297,8 @@ describe Chef::Provider::Package::Yum::RPMPackage do
"B-test" ],
[ "Aa-test",
"aA-test" ],
- %w(1test
-2test),
+ %w{1test
+2test},
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMPackage.new(smaller, "0:0.0.1-1", "x86_64", [])
lg = Chef::Provider::Package::Yum::RPMPackage.new(larger, "0:0.0.1-1", "x86_64", [])
@@ -1310,12 +1310,12 @@ describe Chef::Provider::Package::Yum::RPMPackage do
it "should sort alphabetically based on package arch" do
[
- %w(i386
-x86_64),
- %w(i386
-noarch),
- %w(noarch
-x86_64),
+ %w{i386
+x86_64},
+ %w{i386
+noarch},
+ %w{noarch
+x86_64},
].each do |smaller, larger|
sm = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "0:0.0.1-1", smaller, [])
lg = Chef::Provider::Package::Yum::RPMPackage.new("test-package", "0:0.0.1-1", larger, [])
@@ -2113,7 +2113,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
@node = Chef::Node.new
@events = Chef::EventDispatch::Dispatcher.new
@run_context = Chef::RunContext.new(@node, {}, @events)
- @new_resource = Chef::Resource::Package.new(%w(cups vim))
+ @new_resource = Chef::Resource::Package.new(%w{cups vim})
@status = double("Status", :exitstatus => 0)
@yum_cache = double(
"Chef::Provider::Yum::YumCache",
@@ -2142,7 +2142,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
it "should set the current resources package name to the new resources package name" do
@provider.load_current_resource
- expect(@provider.current_resource.package_name).to eq(%w(cups vim))
+ expect(@provider.current_resource.package_name).to eq(%w{cups vim})
end
it "should set the installed version to nil on the current resource if no installed package" do
@@ -2196,9 +2196,9 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(Chef::Log).to receive(:debug).exactly(1).times.with(%r{candidate version: \["1.2.4-11.18.el5_2.3", "24.4"\]})
expect(Chef::Log).to receive(:debug).at_least(2).times.with(%r{checking yum info})
@provider.load_current_resource
- expect(@provider.new_resource.package_name).to eq(%w(cups emacs))
+ expect(@provider.new_resource.package_name).to eq(%w{cups emacs})
expect(@provider.new_resource.version).to eq(["1.2.4-11.18.el5_2.3", "24.4"])
- expect(@provider.send(:package_name_array)).to eq(%w(cups emacs))
+ expect(@provider.send(:package_name_array)).to eq(%w{cups emacs})
expect(@provider.send(:new_version_array)).to eq(["1.2.4-11.18.el5_2.3", "24.4"])
end
end
@@ -2213,7 +2213,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(@provider).to receive(:yum_command).with(
"-d0 -e0 -y install cups-1.2.4-11.19.el5 vim-1.0"
)
- @provider.install_package(%w(cups vim), ["1.2.4-11.19.el5", "1.0"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
it "should run yum install with the package name, version and arch" do
@@ -2223,7 +2223,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(@provider).to receive(:yum_command).with(
"-d0 -e0 -y install cups-1.2.4-11.19.el5.i386 vim-1.0.i386"
)
- @provider.install_package(%w(cups vim), ["1.2.4-11.19.el5", "1.0"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
it "installs the package with the options given in the resource" do
@@ -2235,7 +2235,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
"-d0 -e0 -y --disablerepo epmd install cups-1.2.4-11.19.el5 vim-1.0"
)
allow(@new_resource).to receive(:options).and_return("--disablerepo epmd")
- @provider.install_package(%w(cups vim), ["1.2.4-11.19.el5", "1.0"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
it "should run yum install with the package name and version when name has arch" do
@@ -2260,7 +2260,7 @@ describe "Chef::Provider::Package::Yum - Multi" do
expect(@provider).to receive(:yum_command).with(
"-d0 -e0 -y install cups-1.2.4-11.19.el5.x86_64 vim-1.0"
)
- @provider.install_package(%w(cups vim), ["1.2.4-11.19.el5", "1.0"])
+ @provider.install_package(%w{cups vim}, ["1.2.4-11.19.el5", "1.0"])
end
end
diff --git a/spec/unit/provider/package/zypper_spec.rb b/spec/unit/provider/package/zypper_spec.rb
index b64ef5ea93..df0a1da9a2 100644
--- a/spec/unit/provider/package/zypper_spec.rb
+++ b/spec/unit/provider/package/zypper_spec.rb
@@ -254,7 +254,7 @@ describe Chef::Provider::Package::Zypper do
shell_out_expectation!(
"zypper --non-interactive --no-gpg-checks install " + "--auto-agree-with-licenses emacs=1.0 vim=2.0"
)
- provider.install_package(%w(emacs vim), ["1.0", "2.0"])
+ provider.install_package(%w{emacs vim}, ["1.0", "2.0"])
end
it "should remove an array of package names and versions" do
@@ -262,7 +262,7 @@ describe Chef::Provider::Package::Zypper do
shell_out_expectation!(
"zypper --non-interactive --no-gpg-checks remove emacs=1.0 vim=2.0"
)
- provider.remove_package(%w(emacs vim), ["1.0", "2.0"])
+ provider.remove_package(%w{emacs vim}, ["1.0", "2.0"])
end
end
end
diff --git a/spec/unit/provider/package_spec.rb b/spec/unit/provider/package_spec.rb
index b2287ed8ce..9f2b019a84 100644
--- a/spec/unit/provider/package_spec.rb
+++ b/spec/unit/provider/package_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Provider::Package do
end
it "raises a Chef::Exceptions::InvalidResourceSpecification if both multipackage and source are provided" do
- new_resource.package_name(%w(a b))
+ new_resource.package_name(%w{a b})
new_resource.source("foo")
expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::InvalidResourceSpecification)
end
@@ -563,8 +563,8 @@ describe "Chef::Provider::Package - Multi" do
let(:node) { Chef::Node.new }
let(:events) { Chef::EventDispatch::Dispatcher.new }
let(:run_context) { Chef::RunContext.new(node, {}, events) }
- let(:new_resource) { Chef::Resource::Package.new(%w(emacs vi)) }
- let(:current_resource) { Chef::Resource::Package.new(%w(emacs vi)) }
+ let(:new_resource) { Chef::Resource::Package.new(%w{emacs vi}) }
+ let(:current_resource) { Chef::Resource::Package.new(%w{emacs vi}) }
let(:candidate_version) { [ "1.0", "6.2" ] }
let(:provider) do
provider = Chef::Provider::Package.new(new_resource, run_context)
@@ -581,7 +581,7 @@ describe "Chef::Provider::Package - Multi" do
it "installs the candidate versions when none are installed" do
expect(provider).to receive(:install_package).with(
- %w(emacs vi),
+ %w{emacs vi},
["1.0", "6.2"],
).and_return(true)
provider.run_action(:install)
@@ -731,7 +731,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages if all are installed" do
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, nil)
provider.run_action(:remove)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -740,7 +740,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages if some are installed" do
current_resource.version ["1.0", nil]
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, nil)
provider.run_action(:remove)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -749,7 +749,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages at a specific version if they are installed at that version" do
new_resource.version ["1.0", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), ["1.0", "6.2"])
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, ["1.0", "6.2"])
provider.run_action(:remove)
expect(new_resource).to be_updated_by_last_action
end
@@ -757,7 +757,7 @@ describe "Chef::Provider::Package - Multi" do
it "should remove the packages at a specific version any are is installed at that version" do
new_resource.version ["0.5", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:remove_package).with(%w(emacs vi), ["0.5", "6.2"])
+ expect(provider).to receive(:remove_package).with(%w{emacs vi}, ["0.5", "6.2"])
provider.run_action(:remove)
expect(new_resource).to be_updated_by_last_action
end
@@ -787,7 +787,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages if all are installed" do
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, nil)
provider.run_action(:purge)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -796,7 +796,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages if some are installed" do
current_resource.version ["1.0", nil]
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), nil)
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, nil)
provider.run_action(:purge)
expect(new_resource).to be_updated
expect(new_resource).to be_updated_by_last_action
@@ -805,7 +805,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages at a specific version if they are installed at that version" do
new_resource.version ["1.0", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), ["1.0", "6.2"])
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, ["1.0", "6.2"])
provider.run_action(:purge)
expect(new_resource).to be_updated_by_last_action
end
@@ -813,7 +813,7 @@ describe "Chef::Provider::Package - Multi" do
it "should purge the packages at a specific version any are is installed at that version" do
new_resource.version ["0.5", "6.2"]
expect(provider).to be_removing_package
- expect(provider).to receive(:purge_package).with(%w(emacs vi), ["0.5", "6.2"])
+ expect(provider).to receive(:purge_package).with(%w{emacs vi}, ["0.5", "6.2"])
provider.run_action(:purge)
expect(new_resource).to be_updated_by_last_action
end
diff --git a/spec/unit/provider/service/arch_service_spec.rb b/spec/unit/provider/service/arch_service_spec.rb
index d95b020357..506a1616c5 100644
--- a/spec/unit/provider/service/arch_service_spec.rb
+++ b/spec/unit/provider/service/arch_service_spec.rb
@@ -180,7 +180,7 @@ RUNNING_PS
it "should add chef to DAEMONS array" do
allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network)")
- expect(@provider).to receive(:update_daemons).with(%w(network chef))
+ expect(@provider).to receive(:update_daemons).with(%w{network chef})
@provider.enable_service()
end
end
diff --git a/spec/unit/provider/service/freebsd_service_spec.rb b/spec/unit/provider/service/freebsd_service_spec.rb
index 224ce3b026..68d4d63991 100644
--- a/spec/unit/provider/service/freebsd_service_spec.rb
+++ b/spec/unit/provider/service/freebsd_service_spec.rb
@@ -495,7 +495,7 @@ EOF
allow(provider).to receive(:service_enable_variable_name).and_return("#{new_resource.service_name}_enable")
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -503,7 +503,7 @@ EOF
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -518,7 +518,7 @@ EOF
allow(provider).to receive(:service_enable_variable_name).and_return(nil)
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
@@ -526,7 +526,7 @@ EOF
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
@@ -558,7 +558,7 @@ EOF
it "should enable the service if it is not enabled and not already specified in the rc.conf file" do
allow(current_resource).to receive(:enabled).and_return(false)
- expect(provider).to receive(:read_rc_conf).and_return(%w(foo bar))
+ expect(provider).to receive(:read_rc_conf).and_return(%w{foo bar})
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
provider.enable_service()
end
diff --git a/spec/unit/provider/service/macosx_spec.rb b/spec/unit/provider/service/macosx_spec.rb
index 0828425523..12f97431ba 100644
--- a/spec/unit/provider/service/macosx_spec.rb
+++ b/spec/unit/provider/service/macosx_spec.rb
@@ -58,7 +58,7 @@ describe Chef::Provider::Service::Macosx do
</plist>
XML
- %w(Daemon Agent).each do |service_type|
+ %w{Daemon Agent}.each do |service_type|
["redis-server", "io.redis.redis-server"].each do |service_name|
["10.9", "10.10", "10.11"].each do |platform_version|
let(:plist) { "/Library/LaunchDaemons/io.redis.redis-server.plist" }
diff --git a/spec/unit/provider/service/openbsd_service_spec.rb b/spec/unit/provider/service/openbsd_service_spec.rb
index 5f5dc80b85..b11015a63a 100644
--- a/spec/unit/provider/service/openbsd_service_spec.rb
+++ b/spec/unit/provider/service/openbsd_service_spec.rb
@@ -338,7 +338,7 @@ describe Chef::Provider::Service::Openbsd do
allow(provider).to receive(:builtin_service_enable_variable_name).and_return("#{new_resource.service_name}_enable")
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -346,7 +346,7 @@ describe Chef::Provider::Service::Openbsd do
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.define_resource_requirements
provider.action = action
@@ -360,7 +360,7 @@ describe Chef::Provider::Service::Openbsd do
allow(provider).to receive(:builtin_service_enable_variable_name).and_return(nil)
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an exception when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
@@ -368,7 +368,7 @@ describe Chef::Provider::Service::Openbsd do
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
provider.action = action
provider.define_resource_requirements
diff --git a/spec/unit/provider/service/redhat_spec.rb b/spec/unit/provider/service/redhat_spec.rb
index 7023e6848a..9b878abcd6 100644
--- a/spec/unit/provider/service/redhat_spec.rb
+++ b/spec/unit/provider/service/redhat_spec.rb
@@ -150,14 +150,14 @@ describe "Chef::Provider::Service::Redhat" do
@provider.define_resource_requirements
end
- %w(start reload restart enable).each do |action|
+ %w{start reload restart enable}.each do |action|
it "should raise an error when the action is #{action}" do
@provider.action = action
expect { @provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Service)
end
end
- %w(stop disable).each do |action|
+ %w{stop disable}.each do |action|
it "should not raise an error when the action is #{action}" do
@provider.action = action
expect { @provider.process_resource_requirements }.not_to raise_error
diff --git a/spec/unit/provider/user_spec.rb b/spec/unit/provider/user_spec.rb
index 6e5a469112..1cdbe462f7 100644
--- a/spec/unit/provider/user_spec.rb
+++ b/spec/unit/provider/user_spec.rb
@@ -192,13 +192,13 @@ describe Chef::Provider::User do
describe "compare_user" do
let(:mapping) {
{
- "username" => %w(adam Adam),
+ "username" => %w{adam Adam},
"comment" => ["Adam Jacob", "adam jacob"],
"uid" => [1000, 1001],
"gid" => [1000, 1001],
"home" => ["/home/adam", "/Users/adam"],
"shell" => ["/usr/bin/zsh", "/bin/bash"],
- "password" => %w(abcd 12345),
+ "password" => %w{abcd 12345},
}
}