summaryrefslogtreecommitdiff
path: root/spec/functional/resource/apt_package_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functional/resource/apt_package_spec.rb')
-rw-r--r--spec/functional/resource/apt_package_spec.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/functional/resource/apt_package_spec.rb b/spec/functional/resource/apt_package_spec.rb
index c032bafc92..c1ac51c4b1 100644
--- a/spec/functional/resource/apt_package_spec.rb
+++ b/spec/functional/resource/apt_package_spec.rb
@@ -50,11 +50,11 @@ module AptServer
def apt_server
@apt_server ||= WEBrick::HTTPServer.new(
- :Port => 9000,
- :DocumentRoot => apt_data_dir + "/var/www/apt",
+ Port: 9000,
+ DocumentRoot: apt_data_dir + "/var/www/apt",
# Make WEBrick quiet, comment out for debug.
- :Logger => Logger.new(StringIO.new),
- :AccessLog => [ StringIO.new, WEBrick::AccessLog::COMMON_LOG_FORMAT ]
+ Logger: Logger.new(StringIO.new),
+ AccessLog: [ StringIO.new, WEBrick::AccessLog::COMMON_LOG_FORMAT ]
)
end
@@ -86,10 +86,10 @@ module AptServer
end
end
-metadata = { :unix_only => true,
- :requires_root => true,
- :provider => { :package => Chef::Provider::Package::Apt },
- :arch => "x86_64" # test packages are 64bit
+metadata = { unix_only: true,
+ requires_root: true,
+ provider: { package: Chef::Provider::Package::Apt },
+ arch: "x86_64" # test packages are 64bit
}
describe Chef::Resource::AptPackage, metadata do
@@ -169,13 +169,13 @@ describe Chef::Resource::AptPackage, metadata do
it "does nothing for action :remove" do
package_resource.run_action(:remove)
- shell_out!("dpkg -l chef-integration-test", :returns => [1])
+ shell_out!("dpkg -l chef-integration-test", returns: [1])
expect(package_resource).not_to be_updated_by_last_action
end
it "does nothing for action :purge" do
package_resource.run_action(:purge)
- shell_out!("dpkg -l chef-integration-test", :returns => [1])
+ shell_out!("dpkg -l chef-integration-test", returns: [1])
expect(package_resource).not_to be_updated_by_last_action
end
@@ -275,7 +275,7 @@ describe Chef::Resource::AptPackage, metadata do
r = base_resource
r.cookbook_name = "preseed"
r.response_file("preseed-template-variables.seed")
- r.response_file_variables({ :template_variable => "SUPPORTS VARIABLES" })
+ r.response_file_variables({ template_variable: "SUPPORTS VARIABLES" })
r
end
@@ -300,13 +300,13 @@ describe Chef::Resource::AptPackage, metadata do
it "does nothing for action :install" do
package_resource.run_action(:install)
- shell_out!("dpkg -l chef-integration-test", :returns => [0])
+ shell_out!("dpkg -l chef-integration-test", returns: [0])
expect(package_resource).not_to be_updated_by_last_action
end
it "does nothing for action :upgrade" do
package_resource.run_action(:upgrade)
- shell_out!("dpkg -l chef-integration-test", :returns => [0])
+ shell_out!("dpkg -l chef-integration-test", returns: [0])
expect(package_resource).not_to be_updated_by_last_action
end
@@ -324,7 +324,7 @@ describe Chef::Resource::AptPackage, metadata do
# un chef-integration-test <none> (no description available)
def pkg_should_be_removed
# will raise if exit code != 0,1
- pkg_check = shell_out!("dpkg -l chef-integration-test", :returns => [0, 1])
+ pkg_check = shell_out!("dpkg -l chef-integration-test", returns: [0, 1])
if pkg_check.exitstatus == 0
expect(pkg_check.stdout).to match(/un[\s]+chef-integration-test/)
@@ -353,13 +353,13 @@ describe Chef::Resource::AptPackage, metadata do
it "does nothing for action :install" do
package_resource.run_action(:install)
- shell_out!("dpkg -l chef-integration-test", :returns => [0])
+ shell_out!("dpkg -l chef-integration-test", returns: [0])
expect(package_resource).not_to be_updated_by_last_action
end
it "upgrades the package for action :upgrade" do
package_resource.run_action(:upgrade)
- dpkg_l = shell_out!("dpkg -l chef-integration-test", :returns => [0])
+ dpkg_l = shell_out!("dpkg -l chef-integration-test", returns: [0])
expect(dpkg_l.stdout).to match(/chef\-integration\-test[\s]+1\.1\-1/)
expect(package_resource).to be_updated_by_last_action
end
@@ -373,7 +373,7 @@ describe Chef::Resource::AptPackage, metadata do
it "upgrades the package for action :install" do
package_resource.run_action(:install)
- dpkg_l = shell_out!("dpkg -l chef-integration-test", :returns => [0])
+ dpkg_l = shell_out!("dpkg -l chef-integration-test", returns: [0])
expect(dpkg_l.stdout).to match(/chef\-integration\-test[\s]+1\.1\-1/)
expect(package_resource).to be_updated_by_last_action
end