summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:13:58 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-02 15:13:58 -0700
commitd7478e406d0bdcc15c8122fb7b4e39ad3208c9ac (patch)
treefd7eaa3d882d97d7013c57dda2886b9dbe7dd390 /spec
parente71560df5cebbfb209089c6255e37e65f0e34d95 (diff)
downloadchef-d7478e406d0bdcc15c8122fb7b4e39ad3208c9ac.tar.gz
Style/MethodCallWithoutArgsParentheses
zero args methods don't get parens. this certainly reads better than the inverse. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/resource/group_spec.rb4
-rw-r--r--spec/functional/resource/locale_spec.rb8
-rw-r--r--spec/support/shared/unit/application_dot_d.rb2
-rw-r--r--spec/unit/application/exit_code_spec.rb2
-rw-r--r--spec/unit/chef_fs/config_spec.rb6
-rw-r--r--spec/unit/client_spec.rb2
-rw-r--r--spec/unit/deprecated_spec.rb2
-rw-r--r--spec/unit/http/json_input_spec.rb2
-rw-r--r--spec/unit/knife/client_bulk_delete_spec.rb4
-rw-r--r--spec/unit/knife/cookbook_delete_spec.rb2
-rw-r--r--spec/unit/knife/node_bulk_delete_spec.rb2
-rw-r--r--spec/unit/knife/node_delete_spec.rb4
-rw-r--r--spec/unit/knife/node_edit_spec.rb2
-rw-r--r--spec/unit/knife/node_environment_set_spec.rb2
-rw-r--r--spec/unit/knife/node_from_file_spec.rb2
-rw-r--r--spec/unit/knife/node_policy_set_spec.rb2
-rw-r--r--spec/unit/knife/node_run_list_add_spec.rb2
-rw-r--r--spec/unit/knife/node_run_list_remove_spec.rb2
-rw-r--r--spec/unit/knife/node_run_list_set_spec.rb2
-rw-r--r--spec/unit/knife/node_show_spec.rb2
-rw-r--r--spec/unit/knife/role_bulk_delete_spec.rb2
-rw-r--r--spec/unit/knife/role_create_spec.rb2
-rw-r--r--spec/unit/knife/role_delete_spec.rb2
-rw-r--r--spec/unit/knife/role_edit_spec.rb2
-rw-r--r--spec/unit/knife/role_env_run_list_add_spec.rb2
-rw-r--r--spec/unit/knife/role_env_run_list_clear_spec.rb2
-rw-r--r--spec/unit/knife/role_env_run_list_remove_spec.rb2
-rw-r--r--spec/unit/knife/role_env_run_list_replace_spec.rb2
-rw-r--r--spec/unit/knife/role_env_run_list_set_spec.rb2
-rw-r--r--spec/unit/knife/role_from_file_spec.rb2
-rw-r--r--spec/unit/knife/role_run_list_add_spec.rb2
-rw-r--r--spec/unit/knife/role_run_list_clear_spec.rb2
-rw-r--r--spec/unit/knife/role_run_list_remove_spec.rb2
-rw-r--r--spec/unit/knife/role_run_list_replace_spec.rb2
-rw-r--r--spec/unit/knife/role_run_list_set_spec.rb2
-rw-r--r--spec/unit/knife/supermarket_share_spec.rb2
-rw-r--r--spec/unit/mixin/homebrew_user_spec.rb2
-rw-r--r--spec/unit/mixin/params_validate_spec.rb2
-rw-r--r--spec/unit/node_spec.rb4
-rw-r--r--spec/unit/provider/apt_update_spec.rb12
-rw-r--r--spec/unit/provider/dsc_script_spec.rb2
-rw-r--r--spec/unit/provider/mount/mount_spec.rb40
-rw-r--r--spec/unit/provider/mount/solaris_spec.rb20
-rw-r--r--spec/unit/provider/osx_profile_spec.rb4
-rw-r--r--spec/unit/provider/package/openbsd_spec.rb12
-rw-r--r--spec/unit/provider/package/smartos_spec.rb4
-rw-r--r--spec/unit/provider/service/arch_service_spec.rb22
-rw-r--r--spec/unit/provider/service/freebsd_service_spec.rb30
-rw-r--r--spec/unit/provider/service/gentoo_service_spec.rb4
-rw-r--r--spec/unit/provider/service/init_service_spec.rb18
-rw-r--r--spec/unit/provider/service/invokercd_service_spec.rb18
-rw-r--r--spec/unit/provider/service/openbsd_service_spec.rb14
-rw-r--r--spec/unit/provider/service/simple_service_spec.rb10
-rw-r--r--spec/unit/provider/service/upstart_service_spec.rb28
-rw-r--r--spec/unit/provider/windows_task_spec.rb2
-rw-r--r--spec/unit/resource/locale_spec.rb24
-rw-r--r--spec/unit/resource/template_spec.rb2
-rw-r--r--spec/unit/resource_collection/resource_list_spec.rb2
-rw-r--r--spec/unit/resource_collection_spec.rb2
-rw-r--r--spec/unit/resource_definition_spec.rb2
-rw-r--r--spec/unit/resource_spec.rb2
-rw-r--r--spec/unit/util/threaded_job_queue_spec.rb4
-rw-r--r--spec/unit/win32/registry_spec.rb10
63 files changed, 192 insertions, 192 deletions
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb
index efa089ca2e..343e4f2f4e 100644
--- a/spec/functional/resource/group_spec.rb
+++ b/spec/functional/resource/group_spec.rb
@@ -152,7 +152,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows do
let(:excluded_members) { [] }
it "should raise an error" do
- expect { group_resource.run_action(tested_action) }.to raise_error()
+ expect { group_resource.run_action(tested_action) }.to raise_error
end
end
@@ -162,7 +162,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows do
end
it "should raise an error" do
- expect { group_resource.run_action(tested_action) }.to raise_error()
+ expect { group_resource.run_action(tested_action) }.to raise_error
end
end
end
diff --git a/spec/functional/resource/locale_spec.rb b/spec/functional/resource/locale_spec.rb
index 83dfc2d007..0103df305b 100644
--- a/spec/functional/resource/locale_spec.rb
+++ b/spec/functional/resource/locale_spec.rb
@@ -61,18 +61,18 @@ describe Chef::Resource::Locale, :requires_root do
context "Unsets system variable" do
it "when LC var is not given" do
- resource.lc_env()
+ resource.lc_env
resource.run_action(:update)
unsets_system_locale("LC_MESSAGES=en_US")
end
it "when lang is not given" do
- resource.lang()
+ resource.lang
resource.run_action(:update)
unsets_system_locale("LANG=en_US")
end
it "when both lang & LC vars are not given" do
- resource.lang()
- resource.lc_env()
+ resource.lang
+ resource.lc_env
resource.run_action(:update)
unsets_system_locale("LANG=en_US", "LC_TIME=en_IN")
sets_system_locale("")
diff --git a/spec/support/shared/unit/application_dot_d.rb b/spec/support/shared/unit/application_dot_d.rb
index b94fa7c184..505fe08190 100644
--- a/spec/support/shared/unit/application_dot_d.rb
+++ b/spec/support/shared/unit/application_dot_d.rb
@@ -39,7 +39,7 @@ shared_examples_for "an application that loads a dot d" do
expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/00-foo.rb").cleanpath.to_s).and_return("foo 0")
expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/01-bar.rb").cleanpath.to_s).and_return("bar 0")
expect(IO).to receive(:read).with(Pathname.new("#{client_d_dir}/02-strings.rb").cleanpath.to_s).and_return("strings 0")
- allow(app).to receive(:apply_config).with(anything(), Chef::Config.platform_specific_path("/etc/chef/client.rb")).and_call_original.ordered
+ allow(app).to receive(:apply_config).with(anything, Chef::Config.platform_specific_path("/etc/chef/client.rb")).and_call_original.ordered
expect(app).to receive(:apply_config).with("foo 0", Pathname.new("#{client_d_dir}/00-foo.rb").cleanpath.to_s).and_call_original.ordered
expect(app).to receive(:apply_config).with("bar 0", Pathname.new("#{client_d_dir}/01-bar.rb").cleanpath.to_s).and_call_original.ordered
expect(app).to receive(:apply_config).with("strings 0", Pathname.new("#{client_d_dir}/02-strings.rb").cleanpath.to_s).and_call_original.ordered
diff --git a/spec/unit/application/exit_code_spec.rb b/spec/unit/application/exit_code_spec.rb
index 6800ad0de5..270f05e598 100644
--- a/spec/unit/application/exit_code_spec.rb
+++ b/spec/unit/application/exit_code_spec.rb
@@ -79,7 +79,7 @@ describe Chef::Application::ExitCode do
end
it "returns GENERIC_FAILURE when no exit code is specified" do
- expect(exit_codes.normalize_exit_code()).to eq(1)
+ expect(exit_codes.normalize_exit_code).to eq(1)
end
it "returns SIGINT_RECEIVED when a SIGINT is received" do
diff --git a/spec/unit/chef_fs/config_spec.rb b/spec/unit/chef_fs/config_spec.rb
index 0adcbbfbfb..f552d454d0 100644
--- a/spec/unit/chef_fs/config_spec.rb
+++ b/spec/unit/chef_fs/config_spec.rb
@@ -23,7 +23,7 @@ require "lib/chef/chef_fs/config.rb"
describe Chef::ChefFS::Config do
describe "initialize" do
it "warns when hosted setups use 'everything'" do
- base_config = Hash.new()
+ base_config = Hash.new
base_config[:repo_mode] = "everything"
base_config[:chef_server_url] = "http://foo.com/organizations/fake_org/"
@@ -34,7 +34,7 @@ describe Chef::ChefFS::Config do
end
it "doesn't warn when hosted setups use 'hosted_everything'" do
- base_config = Hash.new()
+ base_config = Hash.new
base_config[:repo_mode] = "hosted_everything"
base_config[:chef_server_url] = "http://foo.com/organizations/fake_org/"
@@ -45,7 +45,7 @@ describe Chef::ChefFS::Config do
end
it "doesn't warn when non-hosted setups use 'everything'" do
- base_config = Hash.new()
+ base_config = Hash.new
base_config[:repo_mode] = "everything"
base_config[:chef_server_url] = "http://foo.com/"
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index 476647a651..5182717af8 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -647,7 +647,7 @@ describe Chef::Client do
EOM
end
it "should not raise an error" do
- expect { client.load_required_recipe(rest, run_context) }.not_to raise_error()
+ expect { client.load_required_recipe(rest, run_context) }.not_to raise_error
end
end
end
diff --git a/spec/unit/deprecated_spec.rb b/spec/unit/deprecated_spec.rb
index 9c60080cef..4b7bfcce47 100644
--- a/spec/unit/deprecated_spec.rb
+++ b/spec/unit/deprecated_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Deprecated do
let(:location) { "the location" }
it "displays the full URL" do
- expect(TestDeprecation.new().url).to eql("https://docs.chef.io/deprecations_test.html")
+ expect(TestDeprecation.new.url).to eql("https://docs.chef.io/deprecations_test.html")
end
it "formats a complete deprecation message" do
diff --git a/spec/unit/http/json_input_spec.rb b/spec/unit/http/json_input_spec.rb
index a76c8d1dc7..cddad20f55 100644
--- a/spec/unit/http/json_input_spec.rb
+++ b/spec/unit/http/json_input_spec.rb
@@ -21,7 +21,7 @@ require "chef/http/json_input"
describe Chef::HTTP::JSONInput do
- let(:json_encoder) { described_class.new() }
+ let(:json_encoder) { described_class.new }
let(:url) { URI.parse("http://example.com") }
let(:headers) { {} }
diff --git a/spec/unit/knife/client_bulk_delete_spec.rb b/spec/unit/knife/client_bulk_delete_spec.rb
index feebab4986..21bac9d0c0 100644
--- a/spec/unit/knife/client_bulk_delete_spec.rb
+++ b/spec/unit/knife/client_bulk_delete_spec.rb
@@ -45,7 +45,7 @@ describe Chef::Knife::ClientBulkDelete do
clients = Hash.new
nonvalidator_client_names.each do |client_name|
- client = Chef::ApiClientV1.new()
+ client = Chef::ApiClientV1.new
client.name(client_name)
allow(client).to receive(:destroy).and_return(true)
clients[client_name] = client
@@ -59,7 +59,7 @@ describe Chef::Knife::ClientBulkDelete do
clients = Hash.new
validator_client_names.each do |validator_client_name|
- validator_client = Chef::ApiClientV1.new()
+ validator_client = Chef::ApiClientV1.new
validator_client.name(validator_client_name)
allow(validator_client).to receive(:validator).and_return(true)
allow(validator_client).to receive(:destroy).and_return(true)
diff --git a/spec/unit/knife/cookbook_delete_spec.rb b/spec/unit/knife/cookbook_delete_spec.rb
index b2f17778cd..4de907e94d 100644
--- a/spec/unit/knife/cookbook_delete_spec.rb
+++ b/spec/unit/knife/cookbook_delete_spec.rb
@@ -77,7 +77,7 @@ describe Chef::Knife::CookbookDelete do
@knife.version = "1.0.0"
expect(@knife).to receive(:delete_object).with(Chef::CookbookVersion,
"foobar version 1.0.0",
- "cookbook").and_yield()
+ "cookbook").and_yield
expect(@knife).to receive(:delete_request).with("cookbooks/foobar/1.0.0")
@knife.delete_explicit_version
end
diff --git a/spec/unit/knife/node_bulk_delete_spec.rb b/spec/unit/knife/node_bulk_delete_spec.rb
index 2a3563e563..b955b5de6c 100644
--- a/spec/unit/knife/node_bulk_delete_spec.rb
+++ b/spec/unit/knife/node_bulk_delete_spec.rb
@@ -51,7 +51,7 @@ describe Chef::Knife::NodeBulkDelete do
describe "run" do
before do
@inflatedish_list = @nodes.keys.inject({}) do |nodes_by_name, name|
- node = Chef::Node.new()
+ node = Chef::Node.new
node.name(name)
allow(node).to receive(:destroy).and_return(true)
nodes_by_name[name] = node
diff --git a/spec/unit/knife/node_delete_spec.rb b/spec/unit/knife/node_delete_spec.rb
index cc2e0b23af..c5b8925fb5 100644
--- a/spec/unit/knife/node_delete_spec.rb
+++ b/spec/unit/knife/node_delete_spec.rb
@@ -29,8 +29,8 @@ describe Chef::Knife::NodeDelete do
allow(@knife).to receive(:output).and_return(true)
allow(@knife).to receive(:confirm).and_return(true)
- @adam_node = Chef::Node.new()
- @ben_node = Chef::Node.new()
+ @adam_node = Chef::Node.new
+ @ben_node = Chef::Node.new
allow(@ben_node).to receive(:destroy).and_return(true)
allow(@adam_node).to receive(:destroy).and_return(true)
allow(Chef::Node).to receive(:load).with("adam").and_return(@adam_node)
diff --git a/spec/unit/knife/node_edit_spec.rb b/spec/unit/knife/node_edit_spec.rb
index dfc0986ebe..83d78b68f1 100644
--- a/spec/unit/knife/node_edit_spec.rb
+++ b/spec/unit/knife/node_edit_spec.rb
@@ -35,7 +35,7 @@ describe Chef::Knife::NodeEdit do
print_after: nil,
}
@knife.name_args = [ "adam" ]
- @node = Chef::Node.new()
+ @node = Chef::Node.new
end
it "should load the node" do
diff --git a/spec/unit/knife/node_environment_set_spec.rb b/spec/unit/knife/node_environment_set_spec.rb
index 7ceafdad78..5b704c4219 100644
--- a/spec/unit/knife/node_environment_set_spec.rb
+++ b/spec/unit/knife/node_environment_set_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Knife::NodeEnvironmentSet do
@knife = Chef::Knife::NodeEnvironmentSet.new
@knife.name_args = %w{adam bar}
allow(@knife).to receive(:output).and_return(true)
- @node = Chef::Node.new()
+ @node = Chef::Node.new
@node.name("knifetest-node")
@node.chef_environment << "foo"
allow(@node).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/node_from_file_spec.rb b/spec/unit/knife/node_from_file_spec.rb
index cf128a80a0..524780c0b8 100644
--- a/spec/unit/knife/node_from_file_spec.rb
+++ b/spec/unit/knife/node_from_file_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Knife::NodeFromFile do
@knife.name_args = [ "adam.rb" ]
allow(@knife).to receive(:output).and_return(true)
allow(@knife).to receive(:confirm).and_return(true)
- @node = Chef::Node.new()
+ @node = Chef::Node.new
allow(@node).to receive(:save)
allow(@knife.loader).to receive(:load_from).and_return(@node)
@stdout = StringIO.new
diff --git a/spec/unit/knife/node_policy_set_spec.rb b/spec/unit/knife/node_policy_set_spec.rb
index 35306937d8..da84019fe1 100644
--- a/spec/unit/knife/node_policy_set_spec.rb
+++ b/spec/unit/knife/node_policy_set_spec.rb
@@ -20,7 +20,7 @@ require "spec_helper"
describe Chef::Knife::NodePolicySet do
let(:node) do
- node = Chef::Node.new()
+ node = Chef::Node.new
node.name("adam")
node.run_list = ["role[base]"]
node
diff --git a/spec/unit/knife/node_run_list_add_spec.rb b/spec/unit/knife/node_run_list_add_spec.rb
index 03c89ff9eb..b793333c99 100644
--- a/spec/unit/knife/node_run_list_add_spec.rb
+++ b/spec/unit/knife/node_run_list_add_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Knife::NodeRunListAdd do
}
@knife.name_args = [ "adam", "role[monkey]" ]
allow(@knife).to receive(:output).and_return(true)
- @node = Chef::Node.new()
+ @node = Chef::Node.new
allow(@node).to receive(:save).and_return(true)
allow(Chef::Node).to receive(:load).and_return(@node)
end
diff --git a/spec/unit/knife/node_run_list_remove_spec.rb b/spec/unit/knife/node_run_list_remove_spec.rb
index 4f753d7991..a62b6f4b71 100644
--- a/spec/unit/knife/node_run_list_remove_spec.rb
+++ b/spec/unit/knife/node_run_list_remove_spec.rb
@@ -24,7 +24,7 @@ describe Chef::Knife::NodeRunListRemove do
@knife = Chef::Knife::NodeRunListRemove.new
@knife.config[:print_after] = nil
@knife.name_args = [ "adam", "role[monkey]" ]
- @node = Chef::Node.new()
+ @node = Chef::Node.new
@node.name("knifetest-node")
@node.run_list << "role[monkey]"
allow(@node).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/node_run_list_set_spec.rb b/spec/unit/knife/node_run_list_set_spec.rb
index bd55edb997..6246dfce6a 100644
--- a/spec/unit/knife/node_run_list_set_spec.rb
+++ b/spec/unit/knife/node_run_list_set_spec.rb
@@ -25,7 +25,7 @@ describe Chef::Knife::NodeRunListSet do
@knife.config = {}
@knife.name_args = [ "adam", "role[monkey]" ]
allow(@knife).to receive(:output).and_return(true)
- @node = Chef::Node.new()
+ @node = Chef::Node.new
allow(@node).to receive(:save).and_return(true)
allow(Chef::Node).to receive(:load).and_return(@node)
end
diff --git a/spec/unit/knife/node_show_spec.rb b/spec/unit/knife/node_show_spec.rb
index 2f684b27f4..f26bae4233 100644
--- a/spec/unit/knife/node_show_spec.rb
+++ b/spec/unit/knife/node_show_spec.rb
@@ -21,7 +21,7 @@ require "spec_helper"
describe Chef::Knife::NodeShow do
let(:node) do
- node = Chef::Node.new()
+ node = Chef::Node.new
node.name("adam")
node.run_list = ["role[base]"]
node
diff --git a/spec/unit/knife/role_bulk_delete_spec.rb b/spec/unit/knife/role_bulk_delete_spec.rb
index d49adb9354..c39a8ec652 100644
--- a/spec/unit/knife/role_bulk_delete_spec.rb
+++ b/spec/unit/knife/role_bulk_delete_spec.rb
@@ -31,7 +31,7 @@ describe Chef::Knife::RoleBulkDelete do
allow(@knife.ui).to receive(:confirm).and_return(true)
@roles = Hash.new
%w{dev staging production}.each do |role_name|
- role = Chef::Role.new()
+ role = Chef::Role.new
role.name(role_name)
allow(role).to receive(:destroy).and_return(true)
@roles[role_name] = role
diff --git a/spec/unit/knife/role_create_spec.rb b/spec/unit/knife/role_create_spec.rb
index 5e2b2caeb5..fa3ef1c9e8 100644
--- a/spec/unit/knife/role_create_spec.rb
+++ b/spec/unit/knife/role_create_spec.rb
@@ -27,7 +27,7 @@ describe Chef::Knife::RoleCreate do
}
@knife.name_args = [ "adam" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
allow(@role).to receive(:save)
allow(Chef::Role).to receive(:new).and_return(@role)
allow(@knife).to receive(:edit_data).and_return(@role)
diff --git a/spec/unit/knife/role_delete_spec.rb b/spec/unit/knife/role_delete_spec.rb
index 98c0cde9b2..889287fd04 100644
--- a/spec/unit/knife/role_delete_spec.rb
+++ b/spec/unit/knife/role_delete_spec.rb
@@ -28,7 +28,7 @@ describe Chef::Knife::RoleDelete do
@knife.name_args = [ "adam" ]
allow(@knife).to receive(:output).and_return(true)
allow(@knife).to receive(:confirm).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
allow(@role).to receive(:destroy).and_return(true)
allow(Chef::Role).to receive(:load).and_return(@role)
@stdout = StringIO.new
diff --git a/spec/unit/knife/role_edit_spec.rb b/spec/unit/knife/role_edit_spec.rb
index 5e03b7aef3..3828bc51b9 100644
--- a/spec/unit/knife/role_edit_spec.rb
+++ b/spec/unit/knife/role_edit_spec.rb
@@ -25,7 +25,7 @@ describe Chef::Knife::RoleEdit do
@knife.config[:print_after] = nil
@knife.name_args = [ "adam" ]
allow(@knife.ui).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
allow(@role).to receive(:save)
allow(Chef::Role).to receive(:load).and_return(@role)
allow(@knife.ui).to receive(:edit_data).and_return(@role)
diff --git a/spec/unit/knife/role_env_run_list_add_spec.rb b/spec/unit/knife/role_env_run_list_add_spec.rb
index 242beeb4a2..39c9740f50 100644
--- a/spec/unit/knife/role_env_run_list_add_spec.rb
+++ b/spec/unit/knife/role_env_run_list_add_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Knife::RoleEnvRunListAdd do
}
@knife.name_args = [ "will", "QA", "role[monkey]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
allow(@role).to receive(:save).and_return(true)
allow(Chef::Role).to receive(:load).and_return(@role)
end
diff --git a/spec/unit/knife/role_env_run_list_clear_spec.rb b/spec/unit/knife/role_env_run_list_clear_spec.rb
index 7a580ecd4a..14d818fa66 100644
--- a/spec/unit/knife/role_env_run_list_clear_spec.rb
+++ b/spec/unit/knife/role_env_run_list_clear_spec.rb
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListClear do
@knife.name_args = %w{will QA}
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/role_env_run_list_remove_spec.rb b/spec/unit/knife/role_env_run_list_remove_spec.rb
index afbabec528..a9eedf9aa1 100644
--- a/spec/unit/knife/role_env_run_list_remove_spec.rb
+++ b/spec/unit/knife/role_env_run_list_remove_spec.rb
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListRemove do
@knife.name_args = [ "will", "QA", "role[monkey]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/role_env_run_list_replace_spec.rb b/spec/unit/knife/role_env_run_list_replace_spec.rb
index c4d231d638..94ef75fa07 100644
--- a/spec/unit/knife/role_env_run_list_replace_spec.rb
+++ b/spec/unit/knife/role_env_run_list_replace_spec.rb
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListReplace do
@knife.name_args = [ "will", "QA", "role[dude]", "role[person]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/role_env_run_list_set_spec.rb b/spec/unit/knife/role_env_run_list_set_spec.rb
index 79bd3b152e..4fdef5729f 100644
--- a/spec/unit/knife/role_env_run_list_set_spec.rb
+++ b/spec/unit/knife/role_env_run_list_set_spec.rb
@@ -33,7 +33,7 @@ describe Chef::Knife::RoleEnvRunListSet do
@knife.name_args = [ "will", "QA", "role[owen]", "role[mauntel]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/role_from_file_spec.rb b/spec/unit/knife/role_from_file_spec.rb
index 827b8ae04d..65a152c1f0 100644
--- a/spec/unit/knife/role_from_file_spec.rb
+++ b/spec/unit/knife/role_from_file_spec.rb
@@ -30,7 +30,7 @@ describe Chef::Knife::RoleFromFile do
@knife.name_args = [ "adam.rb" ]
allow(@knife).to receive(:output).and_return(true)
allow(@knife).to receive(:confirm).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
allow(@role).to receive(:save)
allow(@knife.loader).to receive(:load_from).and_return(@role)
@stdout = StringIO.new
diff --git a/spec/unit/knife/role_run_list_add_spec.rb b/spec/unit/knife/role_run_list_add_spec.rb
index a38b6de9da..38ead92d86 100644
--- a/spec/unit/knife/role_run_list_add_spec.rb
+++ b/spec/unit/knife/role_run_list_add_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Knife::RoleRunListAdd do
}
@knife.name_args = [ "will", "role[monkey]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
allow(@role).to receive(:save).and_return(true)
allow(Chef::Role).to receive(:load).and_return(@role)
end
diff --git a/spec/unit/knife/role_run_list_clear_spec.rb b/spec/unit/knife/role_run_list_clear_spec.rb
index 8bbc816d6f..b62cc06571 100644
--- a/spec/unit/knife/role_run_list_clear_spec.rb
+++ b/spec/unit/knife/role_run_list_clear_spec.rb
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListClear do
@knife.name_args = [ "will" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/role_run_list_remove_spec.rb b/spec/unit/knife/role_run_list_remove_spec.rb
index c18416feca..c4f0e6d32e 100644
--- a/spec/unit/knife/role_run_list_remove_spec.rb
+++ b/spec/unit/knife/role_run_list_remove_spec.rb
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListRemove do
@knife.name_args = [ "will", "role[monkey]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/role_run_list_replace_spec.rb b/spec/unit/knife/role_run_list_replace_spec.rb
index 9b212de0ae..aa76efe249 100644
--- a/spec/unit/knife/role_run_list_replace_spec.rb
+++ b/spec/unit/knife/role_run_list_replace_spec.rb
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListReplace do
@knife.name_args = [ "will", "role[dude]", "role[person]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/role_run_list_set_spec.rb b/spec/unit/knife/role_run_list_set_spec.rb
index f8e440f524..69543dbda4 100644
--- a/spec/unit/knife/role_run_list_set_spec.rb
+++ b/spec/unit/knife/role_run_list_set_spec.rb
@@ -32,7 +32,7 @@ describe Chef::Knife::RoleRunListSet do
@knife.name_args = [ "will", "role[owen]", "role[mauntel]" ]
allow(@knife).to receive(:output).and_return(true)
- @role = Chef::Role.new()
+ @role = Chef::Role.new
@role.name("will")
allow(@role).to receive(:save).and_return(true)
diff --git a/spec/unit/knife/supermarket_share_spec.rb b/spec/unit/knife/supermarket_share_spec.rb
index 6601cdcd31..6fdcc6c92f 100644
--- a/spec/unit/knife/supermarket_share_spec.rb
+++ b/spec/unit/knife/supermarket_share_spec.rb
@@ -175,7 +175,7 @@ describe Chef::Knife::SupermarketShare do
response_text = Chef::JSONCompat.to_json({ uri: "https://supermarket.chef.io/cookbooks/cookbook_name" })
allow(@upload_response).to receive(:body).and_return(response_text)
allow(@upload_response).to receive(:code).and_return(201)
- expect(Chef::CookbookSiteStreamingUploader).to receive(:post).with(/supermarket\.chef\.io/, anything(), anything(), anything())
+ expect(Chef::CookbookSiteStreamingUploader).to receive(:post).with(/supermarket\.chef\.io/, anything, anything, anything)
@knife.run
end
diff --git a/spec/unit/mixin/homebrew_user_spec.rb b/spec/unit/mixin/homebrew_user_spec.rb
index df89962cce..7d2da85e2d 100644
--- a/spec/unit/mixin/homebrew_user_spec.rb
+++ b/spec/unit/mixin/homebrew_user_spec.rb
@@ -48,7 +48,7 @@ describe Chef::Mixin::HomebrewUser do
let(:brew_owner) { 2001 }
let(:default_brew_path) { "/usr/local/bin/brew" }
let(:stat_double) do
- d = double()
+ d = double
expect(d).to receive(:uid).and_return(brew_owner)
d
end
diff --git a/spec/unit/mixin/params_validate_spec.rb b/spec/unit/mixin/params_validate_spec.rb
index 29d69af403..5f29095bcb 100644
--- a/spec/unit/mixin/params_validate_spec.rb
+++ b/spec/unit/mixin/params_validate_spec.rb
@@ -30,7 +30,7 @@ end
describe Chef::Mixin::ParamsValidate do
before(:each) do
- @vo = TinyClass.new()
+ @vo = TinyClass.new
end
it "should allow a hash and a hash as arguments to validate" do
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index 2d28a3e961..c071e82fae 100644
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -21,7 +21,7 @@ require "ostruct"
describe Chef::Node do
- let(:node) { Chef::Node.new() }
+ let(:node) { Chef::Node.new }
let(:platform_introspector) { node }
it_behaves_like "a platform introspector"
@@ -1207,7 +1207,7 @@ describe Chef::Node do
node.run_list << "role[leninist]"
node.run_list << "recipe[stalinist]"
- @example = Chef::Node.new()
+ @example = Chef::Node.new
@example.name("newname")
@example.chef_environment("prod")
@example.default_attrs = { "alpha" => { "bravo" => "charlie", "delta" => "echo" } }
diff --git a/spec/unit/provider/apt_update_spec.rb b/spec/unit/provider/apt_update_spec.rb
index 5cd327b66b..ed91131aff 100644
--- a/spec/unit/provider/apt_update_spec.rb
+++ b/spec/unit/provider/apt_update_spec.rb
@@ -47,7 +47,7 @@ describe Chef::Provider::AptUpdate do
before do
FileUtils.rmdir config_dir
expect(File.exist?(config_dir)).to be false
- allow_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything())
+ allow_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything)
end
it "should create the directory" do
@@ -66,7 +66,7 @@ describe Chef::Provider::AptUpdate do
describe "#action_update" do
it "should update the apt cache" do
provider.load_current_resource
- expect_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything())
+ expect_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything)
provider.run_action(:update)
expect(new_resource).to be_updated_by_last_action
end
@@ -81,14 +81,14 @@ describe Chef::Provider::AptUpdate do
it "should run if the time stamp is old" do
expect(File).to receive(:mtime).with("#{stamp_dir}/update-success-stamp").and_return(Time.now - 86_500)
- expect_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything())
+ expect_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything)
provider.run_action(:periodic)
expect(new_resource).to be_updated_by_last_action
end
it "should not run if the time stamp is new" do
expect(File).to receive(:mtime).with("#{stamp_dir}/update-success-stamp").and_return(Time.now)
- expect_any_instance_of(Chef::Provider::Execute).not_to receive(:shell_out_compacted!).with(*apt_update_cmd, anything())
+ expect_any_instance_of(Chef::Provider::Execute).not_to receive(:shell_out_compacted!).with(*apt_update_cmd, anything)
provider.run_action(:periodic)
expect(new_resource).to_not be_updated_by_last_action
end
@@ -100,14 +100,14 @@ describe Chef::Provider::AptUpdate do
it "should run if the time stamp is old" do
expect(File).to receive(:mtime).with("#{stamp_dir}/update-success-stamp").and_return(Time.now - 500)
- expect_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything())
+ expect_any_instance_of(Chef::Provider::Execute).to receive(:shell_out_compacted!).with(*apt_update_cmd, anything)
provider.run_action(:periodic)
expect(new_resource).to be_updated_by_last_action
end
it "should not run if the time stamp is new" do
expect(File).to receive(:mtime).with("#{stamp_dir}/update-success-stamp").and_return(Time.now - 300)
- expect_any_instance_of(Chef::Provider::Execute).not_to receive(:shell_out_compacted!).with(*apt_update_cmd, anything())
+ expect_any_instance_of(Chef::Provider::Execute).not_to receive(:shell_out_compacted!).with(*apt_update_cmd, anything)
provider.run_action(:periodic)
expect(new_resource).to_not be_updated_by_last_action
end
diff --git a/spec/unit/provider/dsc_script_spec.rb b/spec/unit/provider/dsc_script_spec.rb
index c880683a0f..a1115150e8 100644
--- a/spec/unit/provider/dsc_script_spec.rb
+++ b/spec/unit/provider/dsc_script_spec.rb
@@ -99,7 +99,7 @@ describe Chef::Provider::DscScript do
it "should noop if neither code or command are provided" do
allow(provider).to receive(:load_current_resource)
generator = double("Chef::Util::DSC::ConfigurationGenerator")
- expect(generator).to receive(:configuration_document_from_script_code).with("", anything(), anything(), anything())
+ expect(generator).to receive(:configuration_document_from_script_code).with("", anything, anything, anything)
allow(Chef::Util::DSC::ConfigurationGenerator).to receive(:new).and_return(generator)
provider.send(:generate_configuration_document, "tmp", nil)
end
diff --git a/spec/unit/provider/mount/mount_spec.rb b/spec/unit/provider/mount/mount_spec.rb
index 2353d992d0..866b548d4e 100644
--- a/spec/unit/provider/mount/mount_spec.rb
+++ b/spec/unit/provider/mount/mount_spec.rb
@@ -83,7 +83,7 @@ describe Chef::Provider::Mount::Mount do
it "should raise an error if the mount device does not exist" do
allow(::File).to receive(:exists?).with("/dev/sdz1").and_return false
- expect { @provider.load_current_resource(); @provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
+ expect { @provider.load_current_resource; @provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
it "should not call mountable? with load_current_resource - CHEF-1565" do
@@ -100,36 +100,36 @@ describe Chef::Provider::Mount::Mount do
@new_resource.device "d21afe51-a0fe-4dc6-9152-ac733763ae0a"
expect(@provider).to receive(:shell_out_compacted).with("/sbin/findfs", "UUID=d21afe51-a0fe-4dc6-9152-ac733763ae0a").and_return(status)
expect(::File).to receive(:exists?).with("").and_return(false)
- expect { @provider.load_current_resource(); @provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
+ expect { @provider.load_current_resource; @provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
it "should raise an error if the mount point does not exist" do
allow(::File).to receive(:exists?).with("/tmp/foo").and_return false
- expect { @provider.load_current_resource(); @provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
+ expect { @provider.load_current_resource; @provider.mountable? }.to raise_error(Chef::Exceptions::Mount)
end
%w{tmpfs fuse cgroup vboxsf zfs}.each do |fstype|
it "does not expect the device to exist for #{fstype}" do
@new_resource.fstype(fstype)
@new_resource.device("whatever")
- expect { @provider.load_current_resource(); @provider.mountable? }.not_to raise_error
+ expect { @provider.load_current_resource; @provider.mountable? }.not_to raise_error
end
end
it "does not expect the device to exist if it's none" do
@new_resource.device("none")
- expect { @provider.load_current_resource(); @provider.mountable? }.not_to raise_error
+ expect { @provider.load_current_resource; @provider.mountable? }.not_to raise_error
end
it "should set mounted true if the mount point is found in the mounts list" do
allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: "/dev/sdz1 on /tmp/foo type ext3 (rw)\n"))
- @provider.load_current_resource()
+ @provider.load_current_resource
expect(@provider.current_resource.mounted).to be_truthy
end
it "should set mounted false if another mount point beginning with the same path is found in the mounts list" do
allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: "/dev/sdz1 on /tmp/foobar type ext3 (rw)\n"))
- @provider.load_current_resource()
+ @provider.load_current_resource
expect(@provider.current_resource.mounted).to be_falsey
end
@@ -141,7 +141,7 @@ describe Chef::Provider::Mount::Mount do
allow(::File).to receive(:readlink).with((@new_resource.device).to_s).and_return(target)
allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: "#{target} on /tmp/foo type ext3 (rw)\n"))
- @provider.load_current_resource()
+ @provider.load_current_resource
expect(@provider.current_resource.mounted).to be_truthy
end
@@ -155,7 +155,7 @@ describe Chef::Provider::Mount::Mount do
allow(::File).to receive(:readlink).with((@new_resource.device).to_s).and_return(target)
allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: "#{absolute_target} on /tmp/foo type ext3 (rw)\n"))
- @provider.load_current_resource()
+ @provider.load_current_resource
expect(@provider.current_resource.mounted).to be_truthy
end
@@ -164,7 +164,7 @@ describe Chef::Provider::Mount::Mount do
mount << "#{@new_resource.device} on #{@new_resource.mount_point} type ext3 (rw)\n"
allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: mount))
- @provider.load_current_resource()
+ @provider.load_current_resource
expect(@provider.current_resource.mounted).to be_truthy
end
@@ -173,13 +173,13 @@ describe Chef::Provider::Mount::Mount do
mount << "/dev/sdy1 on #{@new_resource.mount_point} type ext3 (rw)\n"
allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: mount))
- @provider.load_current_resource()
+ @provider.load_current_resource
expect(@provider.current_resource.mounted).to be_falsey
end
it "mounted should be false if the mount point is not found in the mounts list" do
allow(@provider).to receive(:shell_out!).and_return(OpenStruct.new(stdout: "/dev/sdy1 on /tmp/foo type ext3 (rw)\n"))
- @provider.load_current_resource()
+ @provider.load_current_resource
expect(@provider.current_resource.mounted).to be_falsey
end
@@ -297,14 +297,14 @@ describe Chef::Provider::Mount::Mount do
describe "mount_fs" do
it "should mount the filesystem if it is not mounted" do
expect(@provider).to receive(:shell_out_compacted!).with("mount", "-t", "ext3", "-o", "defaults", "/dev/sdz1", "/tmp/foo")
- @provider.mount_fs()
+ @provider.mount_fs
end
it "should mount the filesystem with options if options were passed" do
options = "rw,noexec,noauto"
@new_resource.options(%w{rw noexec noauto})
expect(@provider).to receive(:shell_out_compacted!).with("mount", "-t", "ext3", "-o", "rw,noexec,noauto", "/dev/sdz1", "/tmp/foo")
- @provider.mount_fs()
+ @provider.mount_fs
end
it "should mount the filesystem specified by uuid", :not_supported_on_solaris do
@@ -315,13 +315,13 @@ describe Chef::Provider::Mount::Mount do
@stdout_mock = double("stdout mock")
allow(@stdout_mock).to receive(:each).and_yield("#{@new_resource.device} on #{@new_resource.mount_point}")
expect(@provider).to receive(:shell_out_compacted!).with("mount", "-t", @new_resource.fstype, "-o", "defaults", "-U", @new_resource.device, @new_resource.mount_point).and_return(@stdout_mock)
- @provider.mount_fs()
+ @provider.mount_fs
end
it "should not mount the filesystem if it is mounted" do
allow(@current_resource).to receive(:mounted).and_return(true)
expect(@provider).not_to receive(:shell_out!)
- @provider.mount_fs()
+ @provider.mount_fs
end
end
@@ -330,13 +330,13 @@ describe Chef::Provider::Mount::Mount do
it "should umount the filesystem if it is mounted" do
@current_resource.mounted(true)
expect(@provider).to receive(:shell_out!).with("umount", "/tmp/foo")
- @provider.umount_fs()
+ @provider.umount_fs
end
it "should not umount the filesystem if it is not mounted" do
@current_resource.mounted(false)
expect(@provider).not_to receive(:shell_out!)
- @provider.umount_fs()
+ @provider.umount_fs
end
end
@@ -363,7 +363,7 @@ describe Chef::Provider::Mount::Mount do
expect(@provider).to receive(:umount_fs)
expect(@provider).to receive(:sleep).with(1)
expect(@provider).to receive(:mount_fs)
- @provider.remount_fs()
+ @provider.remount_fs
end
it "should not try to remount at all if mounted is false" do
@@ -371,7 +371,7 @@ describe Chef::Provider::Mount::Mount do
expect(@provider).not_to receive(:shell_out!)
expect(@provider).not_to receive(:umount_fs)
expect(@provider).not_to receive(:mount_fs)
- @provider.remount_fs()
+ @provider.remount_fs
end
end
diff --git a/spec/unit/provider/mount/solaris_spec.rb b/spec/unit/provider/mount/solaris_spec.rb
index 37c7eb8e38..006eb690cb 100644
--- a/spec/unit/provider/mount/solaris_spec.rb
+++ b/spec/unit/provider/mount/solaris_spec.rb
@@ -350,7 +350,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
expect(File).to receive(:symlink?).with(device).at_least(:once).and_return(true)
expect(File).to receive(:readlink).with(device).at_least(:once).and_return(target)
- provider.load_current_resource()
+ provider.load_current_resource
end
it "should set mounted true if the symlink target of the device is found in the mounts list" do
@@ -387,7 +387,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
expect(File).to receive(:symlink?).with(device).at_least(:once).and_return(true)
expect(File).to receive(:readlink).with(device).at_least(:once).and_return(target)
- provider.load_current_resource()
+ provider.load_current_resource
end
it "should set mounted true if the symlink target of the device is found in the mounts list" do
@@ -411,7 +411,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
EOF
end
it "should set mounted true" do
- provider.load_current_resource()
+ provider.load_current_resource
expect(provider.current_resource.mounted).to be_truthy
end
end
@@ -424,7 +424,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
EOF
end
it "should set mounted false" do
- provider.load_current_resource()
+ provider.load_current_resource
expect(provider.current_resource.mounted).to be_falsey
end
end
@@ -436,7 +436,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
EOF
end
it "should set mounted false" do
- provider.load_current_resource()
+ provider.load_current_resource
expect(provider.current_resource.mounted).to be_falsey
end
end
@@ -448,7 +448,7 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
EOF
end
it "should set mounted false" do
- provider.load_current_resource()
+ provider.load_current_resource
expect(provider.current_resource.mounted).to be_falsey
end
end
@@ -539,28 +539,28 @@ describe Chef::Provider::Mount::Solaris, :unix_only do
describe "mount_fs" do
it "should mount the filesystem" do
expect(provider).to receive(:shell_out_compacted!).with("mount", "-F", fstype, device, mountpoint)
- provider.mount_fs()
+ provider.mount_fs
end
it "should mount the filesystem with options if options were passed" do
options = "logging,noatime,largefiles,nosuid,rw,quota"
new_resource.options(options.split(/,/))
expect(provider).to receive(:shell_out_compacted!).with("mount", "-F", fstype, "-o", options, device, mountpoint)
- provider.mount_fs()
+ provider.mount_fs
end
it "should delete the 'noauto' magic option" do
options = "rw,noauto"
new_resource.options(%w{rw noauto})
expect(provider).to receive(:shell_out_compacted!).with("mount", "-F", fstype, "-o", "rw", device, mountpoint)
- provider.mount_fs()
+ provider.mount_fs
end
end
describe "umount_fs" do
it "should umount the filesystem if it is mounted" do
expect(provider).to receive(:shell_out_compacted!).with("umount", mountpoint)
- provider.umount_fs()
+ provider.umount_fs
end
end
diff --git a/spec/unit/provider/osx_profile_spec.rb b/spec/unit/provider/osx_profile_spec.rb
index 8f99ad6817..a7eaf4cd55 100644
--- a/spec/unit/provider/osx_profile_spec.rb
+++ b/spec/unit/provider/osx_profile_spec.rb
@@ -167,7 +167,7 @@ describe Chef::Provider::OsxProfile do
provider.load_current_resource
allow(provider).to receive(:write_profile_to_disk).and_return(profile_path)
expect(provider).to receive(:shell_out_compacted).with("/usr/bin/profiles", "-I", "-F", profile_path).and_return(shell_out_success)
- provider.action_install()
+ provider.action_install
end
it "should fail if there is no identifier inside the profile" do
@@ -251,7 +251,7 @@ describe Chef::Provider::OsxProfile do
new_resource.action(:remove)
provider.load_current_resource
expect(provider).to receive(:shell_out_compacted).with("/usr/bin/profiles", "-R", "-p", new_resource.identifier).and_return(shell_out_success)
- provider.action_remove()
+ provider.action_remove
end
end
end
diff --git a/spec/unit/provider/package/openbsd_spec.rb b/spec/unit/provider/package/openbsd_spec.rb
index 01d6571f65..48e4b12a72 100644
--- a/spec/unit/provider/package/openbsd_spec.rb
+++ b/spec/unit/provider/package/openbsd_spec.rb
@@ -45,14 +45,14 @@ describe Chef::Provider::Package::Openbsd do
context "when not already installed" do
before do
- allow(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{name}->0", anything()).and_return(instance_double("shellout", stdout: ""))
+ allow(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{name}->0", anything).and_return(instance_double("shellout", stdout: ""))
end
context "when there is a single candidate" do
context "when source is not provided" do
it "should run the installation command" do
- expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything()).and_return(
+ expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything).and_return(
instance_double("shellout", stdout: "#{name}-#{version}\n"))
expect(provider).to receive(:shell_out_compacted!).with(
"pkg_add", "-r", "#{name}-#{version}",
@@ -69,7 +69,7 @@ describe Chef::Provider::Package::Openbsd do
context "if no version is specified" do
it "should raise an exception" do
- expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything()).and_return(
+ expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything).and_return(
instance_double("shellout", stdout: "#{name}-#{version}-#{flavor_a}\n#{name}-#{version}-#{flavor_b}\n"))
expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package, /multiple matching candidates/)
end
@@ -83,8 +83,8 @@ describe Chef::Provider::Package::Openbsd do
context "if no version is specified" do
it "should run the installation command" do
- expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{package_name}->0", anything()).and_return(instance_double("shellout", stdout: ""))
- expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything()).and_return(
+ expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-e", "#{package_name}->0", anything).and_return(instance_double("shellout", stdout: ""))
+ expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", name, anything).and_return(
instance_double("shellout", stdout: "#{name}-#{version}-#{flavor}\n"))
expect(provider).to receive(:shell_out_compacted!).with(
"pkg_add", "-r", "#{name}-#{version}-#{flavor}",
@@ -98,7 +98,7 @@ describe Chef::Provider::Package::Openbsd do
context "if a version is specified" do
it "should use the flavor from the version" do
- expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", "#{name}-#{version}-#{flavor_b}", anything()).and_return(
+ expect(provider).to receive(:shell_out_compacted!).with("pkg_info", "-I", "#{name}-#{version}-#{flavor_b}", anything).and_return(
instance_double("shellout", stdout: "#{name}-#{version}-#{flavor_a}\n"))
new_resource.version("#{version}-#{flavor_b}")
diff --git a/spec/unit/provider/package/smartos_spec.rb b/spec/unit/provider/package/smartos_spec.rb
index cd85e1b3d9..726420fe23 100644
--- a/spec/unit/provider/package/smartos_spec.rb
+++ b/spec/unit/provider/package/smartos_spec.rb
@@ -75,7 +75,7 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
end
it "should lookup the candidate_version if the variable is not already set (pkgin separated by spaces)" do
- search = double()
+ search = double
expect(search).to receive(:each_line)
.and_yield("something-varnish-1.1.1 something varnish like\n")
.and_yield("varnish-2.3.4 actual varnish\n")
@@ -85,7 +85,7 @@ describe Chef::Provider::Package::SmartOS, "load_current_resource" do
end
it "should lookup the candidate_version if the variable is not already set (pkgin separated by semicolons)" do
- search = double()
+ search = double
expect(search).to receive(:each_line)
.and_yield("something-varnish-1.1.1;;something varnish like\n")
.and_yield("varnish-2.3.4;;actual varnish\n")
diff --git a/spec/unit/provider/service/arch_service_spec.rb b/spec/unit/provider/service/arch_service_spec.rb
index faec7ff645..de2bb16a6a 100644
--- a/spec/unit/provider/service/arch_service_spec.rb
+++ b/spec/unit/provider/service/arch_service_spec.rb
@@ -181,7 +181,7 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
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})
- @provider.enable_service()
+ @provider.enable_service
end
end
@@ -202,7 +202,7 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
it "should remove chef from DAEMONS array" do
allow(::File).to receive(:read).with("/etc/rc.conf").and_return("DAEMONS=(network chef)")
expect(@provider).to receive(:update_daemons).with(["network", "!chef"])
- @provider.disable_service()
+ @provider.disable_service
end
end
@@ -223,12 +223,12 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
it "should call the start command if one is specified" do
@new_resource.start_command("/etc/rc.d/chef startyousillysally")
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/chef startyousillysally", default_env: false)
- @provider.start_service()
+ @provider.start_service
end
it "should call '/etc/rc.d/service_name start' if no start command is specified" do
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} start", default_env: false)
- @provider.start_service()
+ @provider.start_service
end
end
@@ -249,12 +249,12 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/etc/rc.d/chef itoldyoutostop")
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/chef itoldyoutostop", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
it "should call '/etc/rc.d/service_name stop' if no stop command is specified" do
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} stop", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
end
@@ -276,20 +276,20 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
it "should call 'restart' on the service_name if the resource supports it" do
@new_resource.supports({ restart: true })
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} restart", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should call the restart_command if one has been specified" do
@new_resource.restart_command("/etc/rc.d/chef restartinafire")
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} restartinafire", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
expect(@provider).to receive(:stop_service)
expect(@provider).to receive(:sleep).with(1)
expect(@provider).to receive(:start_service)
- @provider.restart_service()
+ @provider.restart_service
end
end
@@ -311,13 +311,13 @@ describe Chef::Provider::Service::Arch, "load_current_resource" do
it "should call 'reload' on the service if it supports it" do
@new_resource.supports({ reload: true })
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} reload", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
@new_resource.reload_command("/etc/rc.d/chef lollerpants")
expect(@provider).to receive(:shell_out!).with("/etc/rc.d/#{@new_resource.service_name} lollerpants", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
end
end
diff --git a/spec/unit/provider/service/freebsd_service_spec.rb b/spec/unit/provider/service/freebsd_service_spec.rb
index d33b97d63d..3fb7a0de87 100644
--- a/spec/unit/provider/service/freebsd_service_spec.rb
+++ b/spec/unit/provider/service/freebsd_service_spec.rb
@@ -445,12 +445,12 @@ describe Chef::Provider::Service::Freebsd do
it "should call the start command if one is specified" do
new_resource.start_command("/etc/rc.d/chef startyousillysally")
expect(provider).to receive(:shell_out!).with("/etc/rc.d/chef startyousillysally", default_env: false)
- provider.start_service()
+ provider.start_service
end
it "should call '/usr/local/etc/rc.d/service_name faststart' if no start command is specified" do
expect(provider).to receive(:shell_out!).with("/usr/local/etc/rc.d/#{new_resource.service_name} faststart", default_env: false)
- provider.start_service()
+ provider.start_service
end
end
@@ -458,12 +458,12 @@ describe Chef::Provider::Service::Freebsd do
it "should call the stop command if one is specified" do
new_resource.stop_command("/etc/init.d/chef itoldyoutostop")
expect(provider).to receive(:shell_out!).with("/etc/init.d/chef itoldyoutostop", default_env: false)
- provider.stop_service()
+ provider.stop_service
end
it "should call '/usr/local/etc/rc.d/service_name faststop' if no stop command is specified" do
expect(provider).to receive(:shell_out!).with("/usr/local/etc/rc.d/#{new_resource.service_name} faststop", default_env: false)
- provider.stop_service()
+ provider.stop_service
end
end
@@ -471,19 +471,19 @@ describe Chef::Provider::Service::Freebsd do
it "should call 'restart' on the service_name if the resource supports it" do
new_resource.supports({ restart: true })
expect(provider).to receive(:shell_out!).with("/usr/local/etc/rc.d/#{new_resource.service_name} fastrestart", default_env: false)
- provider.restart_service()
+ provider.restart_service
end
it "should call the restart_command if one has been specified" do
new_resource.restart_command("/etc/init.d/chef restartinafire")
expect(provider).to receive(:shell_out!).with("/etc/init.d/chef restartinafire", default_env: false)
- provider.restart_service()
+ provider.restart_service
end
it "otherwise it should call stop and start" do
expect(provider).to receive(:stop_service)
expect(provider).to receive(:start_service)
- provider.restart_service()
+ provider.restart_service
end
end
end
@@ -550,21 +550,21 @@ describe Chef::Provider::Service::Freebsd do
allow(current_resource).to receive(:enabled).and_return(false)
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "#{new_resource.service_name}_enable=\"NO\"", "bar" ])
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
- provider.enable_service()
+ provider.enable_service
end
it "should not partial match an already enabled service" do
allow(current_resource).to receive(:enabled).and_return(false)
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "thing_#{new_resource.service_name}_enable=\"NO\"", "bar" ])
expect(provider).to receive(:write_rc_conf).with(["foo", "thing_#{new_resource.service_name}_enable=\"NO\"", "bar", "#{new_resource.service_name}_enable=\"YES\""])
- provider.enable_service()
+ provider.enable_service
end
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(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
- provider.enable_service()
+ provider.enable_service
end
it "should not enable the service if it is already enabled" do
@@ -577,7 +577,7 @@ describe Chef::Provider::Service::Freebsd do
allow(current_resource).to receive(:enabled).and_return(false)
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "bar", "\# #{new_resource.service_name}_enable=\"YES\"", "\# #{new_resource.service_name}_enable=\"NO\""])
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"YES\""])
- provider.enable_service()
+ provider.enable_service
end
end
@@ -591,27 +591,27 @@ describe Chef::Provider::Service::Freebsd do
allow(current_resource).to receive(:enabled).and_return(true)
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "#{new_resource.service_name}_enable=\"YES\"", "bar" ])
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"NO\""])
- provider.disable_service()
+ provider.disable_service
end
it "should not disable an enabled service that partially matches" do
allow(current_resource).to receive(:enabled).and_return(true)
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "thing_#{new_resource.service_name}_enable=\"YES\"", "bar" ])
expect(provider).to receive(:write_rc_conf).with(["foo", "thing_#{new_resource.service_name}_enable=\"YES\"", "bar", "#{new_resource.service_name}_enable=\"NO\""])
- provider.disable_service()
+ provider.disable_service
end
it "should not disable the service if it is already disabled" do
allow(current_resource).to receive(:enabled).and_return(false)
expect(provider).not_to receive(:write_rc_conf)
- provider.disable_service()
+ provider.disable_service
end
it "should remove commented out versions of it being disabled or enabled" do
allow(current_resource).to receive(:enabled).and_return(true)
expect(provider).to receive(:read_rc_conf).and_return([ "foo", "bar", "\# #{new_resource.service_name}_enable=\"YES\"", "\# #{new_resource.service_name}_enable=\"NO\""])
expect(provider).to receive(:write_rc_conf).with(["foo", "bar", "#{new_resource.service_name}_enable=\"NO\""])
- provider.disable_service()
+ provider.disable_service
end
end
end
diff --git a/spec/unit/provider/service/gentoo_service_spec.rb b/spec/unit/provider/service/gentoo_service_spec.rb
index 6a928d849b..bc3d0b5c04 100644
--- a/spec/unit/provider/service/gentoo_service_spec.rb
+++ b/spec/unit/provider/service/gentoo_service_spec.rb
@@ -129,14 +129,14 @@ describe Chef::Provider::Service::Gentoo do
describe Chef::Provider::Service::Gentoo, "enable_service" do
it "should call rc-update add *service* default" do
expect(@provider).to receive(:shell_out!).with("/sbin/rc-update add chef default")
- @provider.enable_service()
+ @provider.enable_service
end
end
describe Chef::Provider::Service::Gentoo, "disable_service" do
it "should call rc-update del *service* default" do
expect(@provider).to receive(:shell_out!).with("/sbin/rc-update del chef default")
- @provider.disable_service()
+ @provider.disable_service
end
end
end
diff --git a/spec/unit/provider/service/init_service_spec.rb b/spec/unit/provider/service/init_service_spec.rb
index 38e9ad37de..b75d7c4981 100644
--- a/spec/unit/provider/service/init_service_spec.rb
+++ b/spec/unit/provider/service/init_service_spec.rb
@@ -165,12 +165,12 @@ describe Chef::Provider::Service::Init, "load_current_resource" do
it "should call the start command if one is specified" do
@new_resource.start_command("/etc/init.d/chef startyousillysally")
expect(@provider).to receive(:shell_out!).with("/etc/init.d/chef startyousillysally", default_env: false)
- @provider.start_service()
+ @provider.start_service
end
it "should call '/etc/init.d/service_name start' if no start command is specified" do
expect(@provider).to receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} start", default_env: false)
- @provider.start_service()
+ @provider.start_service
end
end
@@ -178,12 +178,12 @@ describe Chef::Provider::Service::Init, "load_current_resource" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/etc/init.d/chef itoldyoutostop")
expect(@provider).to receive(:shell_out!).with("/etc/init.d/chef itoldyoutostop", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
it "should call '/etc/init.d/service_name stop' if no stop command is specified" do
expect(@provider).to receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} stop", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
end
@@ -191,20 +191,20 @@ describe Chef::Provider::Service::Init, "load_current_resource" do
it "should call 'restart' on the service_name if the resource supports it" do
@new_resource.supports({ restart: true })
expect(@provider).to receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} restart", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should call the restart_command if one has been specified" do
@new_resource.restart_command("/etc/init.d/chef restartinafire")
expect(@provider).to receive(:shell_out!).with("/etc/init.d/#{@new_resource.service_name} restartinafire", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
expect(@provider).to receive(:stop_service)
expect(@provider).to receive(:sleep).with(1)
expect(@provider).to receive(:start_service)
- @provider.restart_service()
+ @provider.restart_service
end
end
@@ -212,13 +212,13 @@ describe Chef::Provider::Service::Init, "load_current_resource" do
it "should call 'reload' on the service if it supports it" do
@new_resource.supports({ reload: true })
expect(@provider).to receive(:shell_out!).with("/etc/init.d/chef reload", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
@new_resource.reload_command("/etc/init.d/chef lollerpants")
expect(@provider).to receive(:shell_out!).with("/etc/init.d/chef lollerpants", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
end
diff --git a/spec/unit/provider/service/invokercd_service_spec.rb b/spec/unit/provider/service/invokercd_service_spec.rb
index fb1a29fa43..1b3344e77b 100644
--- a/spec/unit/provider/service/invokercd_service_spec.rb
+++ b/spec/unit/provider/service/invokercd_service_spec.rb
@@ -152,12 +152,12 @@ describe Chef::Provider::Service::Invokercd, "load_current_resource" do
it "should call the start command if one is specified" do
@new_resource.start_command("/usr/sbin/invoke-rc.d chef startyousillysally")
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d chef startyousillysally", default_env: false)
- @provider.start_service()
+ @provider.start_service
end
it "should call '/usr/sbin/invoke-rc.d service_name start' if no start command is specified" do
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} start", default_env: false)
- @provider.start_service()
+ @provider.start_service
end
end
@@ -165,12 +165,12 @@ describe Chef::Provider::Service::Invokercd, "load_current_resource" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/usr/sbin/invoke-rc.d chef itoldyoutostop")
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d chef itoldyoutostop", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
it "should call '/usr/sbin/invoke-rc.d service_name stop' if no stop command is specified" do
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} stop", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
end
@@ -178,20 +178,20 @@ describe Chef::Provider::Service::Invokercd, "load_current_resource" do
it "should call 'restart' on the service_name if the resource supports it" do
@new_resource.supports({ restart: true })
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} restart", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should call the restart_command if one has been specified" do
@new_resource.restart_command("/usr/sbin/invoke-rc.d chef restartinafire")
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d #{@new_resource.service_name} restartinafire", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do
expect(@provider).to receive(:stop_service)
expect(@provider).to receive(:sleep).with(1)
expect(@provider).to receive(:start_service)
- @provider.restart_service()
+ @provider.restart_service
end
end
@@ -199,13 +199,13 @@ describe Chef::Provider::Service::Invokercd, "load_current_resource" do
it "should call 'reload' on the service if it supports it" do
@new_resource.supports({ reload: true })
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d chef reload", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
it "should should run the user specified reload command if one is specified and the service doesn't support reload" do
@new_resource.reload_command("/usr/sbin/invoke-rc.d chef lollerpants")
expect(@provider).to receive(:shell_out!).with("/usr/sbin/invoke-rc.d chef lollerpants", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
end
end
diff --git a/spec/unit/provider/service/openbsd_service_spec.rb b/spec/unit/provider/service/openbsd_service_spec.rb
index 913fddc1cf..9cb8a2b5dc 100644
--- a/spec/unit/provider/service/openbsd_service_spec.rb
+++ b/spec/unit/provider/service/openbsd_service_spec.rb
@@ -286,12 +286,12 @@ describe Chef::Provider::Service::Openbsd do
it "should call the start command if one is specified" do
new_resource.start_command("/etc/rc.d/chef startyousillysally")
expect(provider).to receive(:shell_out!).with("/etc/rc.d/chef startyousillysally", default_env: false)
- provider.start_service()
+ provider.start_service
end
it "should call '/usr/local/etc/rc.d/service_name start' if no start command is specified" do
expect(provider).to receive(:shell_out!).with("/etc/rc.d/#{new_resource.service_name} start", default_env: false)
- provider.start_service()
+ provider.start_service
end
end
@@ -299,12 +299,12 @@ describe Chef::Provider::Service::Openbsd do
it "should call the stop command if one is specified" do
new_resource.stop_command("/etc/init.d/chef itoldyoutostop")
expect(provider).to receive(:shell_out!).with("/etc/init.d/chef itoldyoutostop", default_env: false)
- provider.stop_service()
+ provider.stop_service
end
it "should call '/usr/local/etc/rc.d/service_name stop' if no stop command is specified" do
expect(provider).to receive(:shell_out!).with("/etc/rc.d/#{new_resource.service_name} stop", default_env: false)
- provider.stop_service()
+ provider.stop_service
end
end
@@ -313,20 +313,20 @@ describe Chef::Provider::Service::Openbsd do
let(:supports) { { restart: true } }
it "should call 'restart' on the service_name if the resource supports it" do
expect(provider).to receive(:shell_out!).with("/etc/rc.d/#{new_resource.service_name} restart", default_env: false)
- provider.restart_service()
+ provider.restart_service
end
end
it "should call the restart_command if one has been specified" do
new_resource.restart_command("/etc/init.d/chef restartinafire")
expect(provider).to receive(:shell_out!).with("/etc/init.d/chef restartinafire", default_env: false)
- provider.restart_service()
+ provider.restart_service
end
it "otherwise it should call stop and start" do
expect(provider).to receive(:stop_service)
expect(provider).to receive(:start_service)
- provider.restart_service()
+ provider.restart_service
end
end
end
diff --git a/spec/unit/provider/service/simple_service_spec.rb b/spec/unit/provider/service/simple_service_spec.rb
index 2a0ebea1dc..2546f9cef7 100644
--- a/spec/unit/provider/service/simple_service_spec.rb
+++ b/spec/unit/provider/service/simple_service_spec.rb
@@ -108,7 +108,7 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do
it "should call the start command if one is specified" do
@new_resource.start_command((@new_resource.start_command).to_s)
expect(@provider).to receive(:shell_out!).with((@new_resource.start_command).to_s, default_env: false)
- @provider.start_service()
+ @provider.start_service
end
it "should raise an exception if no start command is specified" do
@@ -122,7 +122,7 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do
it "should call the stop command if one is specified" do
@new_resource.stop_command("/etc/init.d/themadness stop")
expect(@provider).to receive(:shell_out!).with("/etc/init.d/themadness stop", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
it "should raise an exception if no stop command is specified" do
@@ -136,7 +136,7 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do
it "should call the restart command if one has been specified" do
@new_resource.restart_command("/etc/init.d/foo restart")
expect(@provider).to receive(:shell_out!).with("/etc/init.d/foo restart", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should raise an exception if the resource doesn't support restart, no restart command is provided, and no stop command is provided" do
@@ -149,7 +149,7 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do
expect(@provider).to receive(:stop_service)
expect(@provider).to receive(:sleep).with(1)
expect(@provider).to receive(:start_service)
- @provider.restart_service()
+ @provider.restart_service
end
end
@@ -163,7 +163,7 @@ describe Chef::Provider::Service::Simple, "load_current_resource" do
it "should should run the user specified reload command if one is specified" do
@new_resource.reload_command("kill -9 1")
expect(@provider).to receive(:shell_out!).with("kill -9 1", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
end
end
diff --git a/spec/unit/provider/service/upstart_service_spec.rb b/spec/unit/provider/service/upstart_service_spec.rb
index 365201cb38..572246a807 100644
--- a/spec/unit/provider/service/upstart_service_spec.rb
+++ b/spec/unit/provider/service/upstart_service_spec.rb
@@ -242,7 +242,7 @@ describe Chef::Provider::Service::Upstart do
allow(@current_resource).to receive(:enabled).and_return(false)
expect(@file).to receive(:search_file_replace)
expect(@file).to receive(:write_file)
- @provider.enable_service()
+ @provider.enable_service
end
it "should disable the service if it is enabled" do
@@ -251,7 +251,7 @@ describe Chef::Provider::Service::Upstart do
allow(@current_resource).to receive(:enabled).and_return(true)
expect(@file).to receive(:search_file_replace)
expect(@file).to receive(:write_file)
- @provider.disable_service()
+ @provider.disable_service
end
end
@@ -268,19 +268,19 @@ describe Chef::Provider::Service::Upstart do
@provider.upstart_service_running = false
@new_resource.start_command("/sbin/rsyslog startyousillysally")
expect(@provider).to receive(:shell_out!).with("/sbin/rsyslog startyousillysally", default_env: false)
- @provider.start_service()
+ @provider.start_service
end
it "should call '/sbin/start service_name' if no start command is specified" do
@provider.upstart_service_running = false
expect(@provider).to receive(:shell_out!).with("/sbin/start #{@new_resource.service_name}", default_env: false).and_return(shell_out_success)
- @provider.start_service()
+ @provider.start_service
end
it "should not call '/sbin/start service_name' if it is already running" do
@provider.upstart_service_running = true
expect(@provider).not_to receive(:shell_out!)
- @provider.start_service()
+ @provider.start_service
end
it "should pass parameters to the start command if they are provided" do
@@ -289,14 +289,14 @@ describe Chef::Provider::Service::Upstart do
@provider = Chef::Provider::Service::Upstart.new(@new_resource, @run_context)
@provider.current_resource = @current_resource
expect(@provider).to receive(:shell_out!).with("/sbin/start rsyslog OSD_ID=2", default_env: false).and_return(shell_out_success)
- @provider.start_service()
+ @provider.start_service
end
it "should call the restart command if one is specified" do
allow(@current_resource).to receive(:running).and_return(true)
@new_resource.restart_command("/sbin/rsyslog restartyousillysally")
expect(@provider).to receive(:shell_out!).with("/sbin/rsyslog restartyousillysally", default_env: false)
- @provider.restart_service()
+ @provider.restart_service
end
it "should call start/sleep/stop if no restart command is specified" do
@@ -304,47 +304,47 @@ describe Chef::Provider::Service::Upstart do
expect(@provider).to receive(:stop_service)
expect(@provider).to receive(:sleep).with(1)
expect(@provider).to receive(:start_service)
- @provider.restart_service()
+ @provider.restart_service
end
it "should call '/sbin/start service_name' if restart_service is called for a stopped service" do
@provider.upstart_service_running = false
allow(@current_resource).to receive(:running).and_return(false)
expect(@provider).to receive(:shell_out!).with("/sbin/start #{@new_resource.service_name}", default_env: false).and_return(shell_out_success)
- @provider.restart_service()
+ @provider.restart_service
end
it "should call the reload command if one is specified" do
allow(@current_resource).to receive(:running).and_return(true)
@new_resource.reload_command("/sbin/rsyslog reloadyousillysally")
expect(@provider).to receive(:shell_out!).with("/sbin/rsyslog reloadyousillysally", default_env: false)
- @provider.reload_service()
+ @provider.reload_service
end
it "should call '/sbin/reload service_name' if no reload command is specified" do
allow(@current_resource).to receive(:running).and_return(true)
expect(@provider).to receive(:shell_out!).with("/sbin/reload #{@new_resource.service_name}", default_env: false).and_return(shell_out_success)
- @provider.reload_service()
+ @provider.reload_service
end
it "should call the stop command if one is specified" do
@provider.upstart_service_running = true
@new_resource.stop_command("/sbin/rsyslog stopyousillysally")
expect(@provider).to receive(:shell_out!).with("/sbin/rsyslog stopyousillysally", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
end
it "should call '/sbin/stop service_name' if no stop command is specified" do
@provider.upstart_service_running = true
expect(@provider).to receive(:shell_out!).with("/sbin/stop #{@new_resource.service_name}", default_env: false).and_return(shell_out_success)
- @provider.stop_service()
+ @provider.stop_service
end
it "should not call '/sbin/stop service_name' if it is already stopped" do
@provider.upstart_service_running = false
allow(@current_resource).to receive(:running).and_return(false)
expect(@provider).not_to receive(:shell_out!).with("/sbin/stop #{@new_resource.service_name}", default_env: false)
- @provider.stop_service()
+ @provider.stop_service
expect(@upstart_service_running).to be_falsey
end
end
diff --git a/spec/unit/provider/windows_task_spec.rb b/spec/unit/provider/windows_task_spec.rb
index 8cce861f2a..74e1dc1de7 100644
--- a/spec/unit/provider/windows_task_spec.rb
+++ b/spec/unit/provider/windows_task_spec.rb
@@ -20,7 +20,7 @@ require "spec_helper"
describe Chef::Provider::WindowsTask, :windows_only do
let(:new_resource) { Chef::Resource::WindowsTask.new("sample_task") }
- let(:current_resource) { Chef::Resource::WindowsTask.new() }
+ let(:current_resource) { Chef::Resource::WindowsTask.new }
let(:provider) do
node = Chef::Node.new
diff --git a/spec/unit/resource/locale_spec.rb b/spec/unit/resource/locale_spec.rb
index 544f6342c5..9d0061eb5b 100644
--- a/spec/unit/resource/locale_spec.rb
+++ b/spec/unit/resource/locale_spec.rb
@@ -91,7 +91,7 @@ describe Chef::Resource::Locale do
end
context "without lang" do
it "returns an empty array" do
- resource.lang()
+ resource.lang
resource.lc_env({ "LC_TIME" => "en_AG.utf8", "LC_MESSAGES" => "en_AG.utf8" })
expect(provider.unavailable_locales).to eq([])
end
@@ -99,14 +99,14 @@ describe Chef::Resource::Locale do
context "without lc_env" do
it "returns an empty array" do
resource.lang("en_US")
- resource.lc_env()
+ resource.lc_env
expect(provider.unavailable_locales).to eq([])
end
end
context "without both" do
it "returns an empty array" do
- resource.lang()
- resource.lc_env()
+ resource.lang
+ resource.lc_env
expect(provider.unavailable_locales).to eq([])
end
end
@@ -122,7 +122,7 @@ describe Chef::Resource::Locale do
end
context "without lang" do
it "returns list" do
- resource.lang()
+ resource.lang
resource.lc_env({ "LC_TIME" => "en_AG.utf8", "LC_MESSAGES" => "en_US.utf8" })
expect(provider.unavailable_locales).to eq(["en_US.utf8"])
end
@@ -130,14 +130,14 @@ describe Chef::Resource::Locale do
context "without lc_env" do
it "returns list" do
resource.lang("de_DE")
- resource.lc_env()
+ resource.lc_env
expect(provider.unavailable_locales).to eq(["de_DE"])
end
end
context "without both" do
it "returns an empty array" do
- resource.lang()
- resource.lc_env()
+ resource.lang
+ resource.lc_env
expect(provider.unavailable_locales).to eq([])
end
end
@@ -166,7 +166,7 @@ describe Chef::Resource::Locale do
end
context "without lang" do
it "returns a valid string" do
- resource.lang()
+ resource.lang
resource.lc_env({ "LC_TIME" => "en_AG.utf8", "LC_MESSAGES" => "en_AG.utf8" })
expect(provider.new_content).to eq("LC_MESSAGES=en_AG.utf8\nLC_TIME=en_AG.utf8\n")
end
@@ -174,14 +174,14 @@ describe Chef::Resource::Locale do
context "without lc_env" do
it "returns a valid string" do
resource.lang("en_US")
- resource.lc_env()
+ resource.lc_env
expect(provider.new_content).to eq("LANG=en_US\n")
end
end
context "without both" do
it "returns string with only new-line character" do
- resource.lang()
- resource.lc_env()
+ resource.lang
+ resource.lc_env
expect(provider.new_content).to eq("\n")
end
end
diff --git a/spec/unit/resource/template_spec.rb b/spec/unit/resource/template_spec.rb
index 9ca1f7617f..3c16f99c4a 100644
--- a/spec/unit/resource/template_spec.rb
+++ b/spec/unit/resource/template_spec.rb
@@ -186,7 +186,7 @@ describe Chef::Resource::Template do
end
it "raises an error when no block or module name is given for helpers definition" do
- expect { resource.helpers() }.to raise_error(Chef::Exceptions::ValidationFailed)
+ expect { resource.helpers }.to raise_error(Chef::Exceptions::ValidationFailed)
end
it "raises an error when a non-module is given for helpers definition" do
diff --git a/spec/unit/resource_collection/resource_list_spec.rb b/spec/unit/resource_collection/resource_list_spec.rb
index dabb8f037d..05363c20b1 100644
--- a/spec/unit/resource_collection/resource_list_spec.rb
+++ b/spec/unit/resource_collection/resource_list_spec.rb
@@ -19,7 +19,7 @@
require "spec_helper"
describe Chef::ResourceCollection::ResourceList do
- let(:resource_list) { Chef::ResourceCollection::ResourceList.new() }
+ let(:resource_list) { Chef::ResourceCollection::ResourceList.new }
let(:resource) { Chef::Resource::ZenMaster.new("makoto") }
let(:second_resource) { Chef::Resource::ZenMaster.new("hattori") }
diff --git a/spec/unit/resource_collection_spec.rb b/spec/unit/resource_collection_spec.rb
index 7f59246a88..a26616d454 100644
--- a/spec/unit/resource_collection_spec.rb
+++ b/spec/unit/resource_collection_spec.rb
@@ -20,7 +20,7 @@
require "spec_helper"
describe Chef::ResourceCollection do
- let(:rc) { Chef::ResourceCollection.new() }
+ let(:rc) { Chef::ResourceCollection.new }
let(:resource) { Chef::Resource::ZenMaster.new("makoto") }
it "should throw an error when calling a non-delegated method" do
diff --git a/spec/unit/resource_definition_spec.rb b/spec/unit/resource_definition_spec.rb
index 5be3e59009..2e3fc63260 100644
--- a/spec/unit/resource_definition_spec.rb
+++ b/spec/unit/resource_definition_spec.rb
@@ -19,7 +19,7 @@
require "spec_helper"
describe Chef::ResourceDefinition do
- let(:defn) { Chef::ResourceDefinition.new() }
+ let(:defn) { Chef::ResourceDefinition.new }
describe "initialize" do
it "should be a Chef::ResourceDefinition" do
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 5ca563a7ef..6745dd448d 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -838,7 +838,7 @@ describe Chef::Resource do
it "should print \"skipped due to action :nothing\" message for doc formatter when action is :nothing" do
fdoc = Chef::Formatters.new(:doc, STDOUT, STDERR)
allow(run_context).to receive(:events).and_return(fdoc)
- expect(fdoc).to receive(:puts).with(" (skipped due to action :nothing)", anything())
+ expect(fdoc).to receive(:puts).with(" (skipped due to action :nothing)", anything)
resource.should_skip?(:nothing)
end
diff --git a/spec/unit/util/threaded_job_queue_spec.rb b/spec/unit/util/threaded_job_queue_spec.rb
index 8a89943a8a..48a34bce31 100644
--- a/spec/unit/util/threaded_job_queue_spec.rb
+++ b/spec/unit/util/threaded_job_queue_spec.rb
@@ -22,7 +22,7 @@ describe Chef::Util::ThreadedJobQueue do
let(:queue) { Chef::Util::ThreadedJobQueue.new }
it "should pass mutex to jobs with an arity of 1" do
- job = double()
+ job = double
expect(job).to receive(:arity).at_least(:once).and_return(1)
expect(job).to receive(:call).exactly(5).times.with(an_instance_of(Mutex))
@@ -31,7 +31,7 @@ describe Chef::Util::ThreadedJobQueue do
end
it "should pass nothing to jobs with an arity of 0" do
- job = double()
+ job = double
expect(job).to receive(:arity).at_least(:once).and_return(0)
expect(job).to receive(:call).exactly(5).times.with(no_args)
diff --git a/spec/unit/win32/registry_spec.rb b/spec/unit/win32/registry_spec.rb
index 574f38d8e2..2485d9ee47 100644
--- a/spec/unit/win32/registry_spec.rb
+++ b/spec/unit/win32/registry_spec.rb
@@ -29,7 +29,7 @@ describe Chef::Win32::Registry do
let(:key_to_delete) { "OpscodeNumbers" }
let(:sub_key) { "OpscodePrimes" }
let(:missing_key_path) { 'HKCU\Software' }
- let(:registry) { Chef::Win32::Registry.new() }
+ let(:registry) { Chef::Win32::Registry.new }
let(:hive_mock) { double("::Win32::Registry::KHKEY_CURRENT_USER") }
let(:reg_mock) { double("reg") }
@@ -252,7 +252,7 @@ describe Chef::Win32::Registry do
expect(registry).to receive(:key_exists!).with(key_path).and_return(true)
expect(registry).to receive(:get_hive_and_key).with(key_path).and_return([hive_mock, key])
expect(hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | registry.registry_system_architecture).and_yield(reg_mock)
- expect(reg_mock).to receive(:each_key).and_return(no_args())
+ expect(reg_mock).to receive(:each_key).and_return(no_args)
expect(registry.has_subkeys?(key_path)).to eq(false)
end
@@ -290,7 +290,7 @@ describe Chef::Win32::Registry do
expect(registry).to receive(:key_exists!).with(key_path).and_return(true)
expect(registry).to receive(:get_hive_and_key).with(key_path).and_return([hive_mock, key])
expect(hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | registry.registry_system_architecture).and_yield(reg_mock)
- expect(reg_mock).to receive(:any?).and_yield(no_args())
+ expect(reg_mock).to receive(:any?).and_yield(no_args)
registry.value_exists?(key_path, value1) == false
end
end
@@ -305,7 +305,7 @@ describe Chef::Win32::Registry do
expect(registry).to receive(:key_exists!).with(key_path).and_return(true)
expect(registry).to receive(:get_hive_and_key).with(key_path).and_return([hive_mock, key])
expect(registry).to receive(:get_type_from_name).with(:string).and_return(1)
- expect(reg_mock).to receive(:each).with(no_args()).and_yield("one", 1, "1")
+ expect(reg_mock).to receive(:each).with(no_args).and_yield("one", 1, "1")
expect(hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | registry.registry_system_architecture).and_yield(reg_mock)
expect(registry.data_exists?(key_path, value1)).to eq(true)
end
@@ -315,7 +315,7 @@ describe Chef::Win32::Registry do
expect(registry).to receive(:get_hive_and_key).with(key_path).and_return([hive_mock, key])
expect(hive_mock).to receive(:open).with(key, ::Win32::Registry::KEY_READ | registry.registry_system_architecture).and_yield(reg_mock)
expect(registry).to receive(:get_type_from_name).with(:string).and_return(1)
- expect(reg_mock).to receive(:each).with(no_args()).and_yield("one", 1, "2")
+ expect(reg_mock).to receive(:each).with(no_args).and_yield("one", 1, "2")
expect(registry.data_exists?(key_path, value1)).to eq(false)
end
end