diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 15:13:58 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 15:13:58 -0700 |
commit | d7478e406d0bdcc15c8122fb7b4e39ad3208c9ac (patch) | |
tree | fd7eaa3d882d97d7013c57dda2886b9dbe7dd390 /spec/unit/knife | |
parent | e71560df5cebbfb209089c6255e37e65f0e34d95 (diff) | |
download | chef-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/unit/knife')
28 files changed, 30 insertions, 30 deletions
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 |