summaryrefslogtreecommitdiff
path: root/spec/integration/knife
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-07-02 10:25:16 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-07-02 10:25:16 -0700
commit35603c7ce1bd3ccf35334ed65152140f0ecaf080 (patch)
tree452c84ce196ce00d672c71a8fa65f86c5a074fac /spec/integration/knife
parenteda2808dce8146bfdb308dd658b1dd565df3562b (diff)
downloadchef-35603c7ce1bd3ccf35334ed65152140f0ecaf080.tar.gz
fix Style/HashSyntax
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/integration/knife')
-rw-r--r--spec/integration/knife/chef_fs_data_store_spec.rb10
-rw-r--r--spec/integration/knife/chef_repo_path_spec.rb6
-rw-r--r--spec/integration/knife/chef_repository_file_system_spec.rb6
-rw-r--r--spec/integration/knife/chefignore_spec.rb4
-rw-r--r--spec/integration/knife/common_options_spec.rb4
-rw-r--r--spec/integration/knife/cookbook_api_ipv6_spec.rb8
-rw-r--r--spec/integration/knife/delete_spec.rb12
-rw-r--r--spec/integration/knife/deps_spec.rb114
-rw-r--r--spec/integration/knife/diff_spec.rb16
-rw-r--r--spec/integration/knife/download_spec.rb14
-rw-r--r--spec/integration/knife/list_spec.rb6
-rw-r--r--spec/integration/knife/raw_spec.rb10
-rw-r--r--spec/integration/knife/show_spec.rb6
-rw-r--r--spec/integration/knife/upload_spec.rb24
14 files changed, 120 insertions, 120 deletions
diff --git a/spec/integration/knife/chef_fs_data_store_spec.rb b/spec/integration/knife/chef_fs_data_store_spec.rb
index 02508b799d..1e9d1c65b4 100644
--- a/spec/integration/knife/chef_fs_data_store_spec.rb
+++ b/spec/integration/knife/chef_fs_data_store_spec.rb
@@ -190,7 +190,7 @@ EOM
end
it "knife cookbook upload works" do
- knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} x").should_succeed :stderr => <<EOM
+ knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} x").should_succeed stderr: <<EOM
Uploading x [1.0.0]
Uploaded 1 cookbook.
EOM
@@ -218,7 +218,7 @@ EOM
knife("list --local /roles").should_succeed "/roles/x.json\n"
end
- it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", :skip => (RUBY_VERSION < "1.9") do
+ it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", skip: (RUBY_VERSION < "1.9") do
knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ )
expect(IO.read(path_to("roles/x.json"))).to eq <<EOM.strip
{
@@ -247,7 +247,7 @@ EOM
end
it "knife cookbook upload works" do
- knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} z").should_succeed :stderr => <<EOM
+ knife("cookbook upload -z --cookbook-path #{path_to('cookbooks_to_upload')} z").should_succeed stderr: <<EOM
Uploading z [1.0.0]
Uploaded 1 cookbook.
EOM
@@ -281,7 +281,7 @@ EOM
knife("list --local /roles").should_succeed "/roles/z.json\n"
end
- it "After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty", :skip => (RUBY_VERSION < "1.9") do
+ it "After knife raw -z -i rolestuff.json -m POST /roles, the output is pretty", skip: (RUBY_VERSION < "1.9") do
knife("raw -z -i #{path_to('rolestuff.json')} -m POST /roles").should_succeed( /uri/ )
expect(IO.read(path_to("roles/x.json"))).to eq <<EOM.strip
{
@@ -489,7 +489,7 @@ EOM
knife("list --local /users").should_succeed "/users/x.json\n"
end
- it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", :skip => (RUBY_VERSION < "1.9") do
+ it "After knife raw -z -i rolestuff.json -m PUT /roles/x, the output is pretty", skip: (RUBY_VERSION < "1.9") do
knife("raw -z -i #{path_to('rolestuff.json')} -m PUT /roles/x").should_succeed( /"x"/ )
expect(IO.read(path_to("roles/x.json"))).to eq <<EOM.strip
{
diff --git a/spec/integration/knife/chef_repo_path_spec.rb b/spec/integration/knife/chef_repo_path_spec.rb
index e609fa60b3..9cb093c178 100644
--- a/spec/integration/knife/chef_repo_path_spec.rb
+++ b/spec/integration/knife/chef_repo_path_spec.rb
@@ -391,7 +391,7 @@ EOM
file "cookbooks2/blah/metadata.rb", ""
end
it "knife list -Rfp cookbooks shows files in blah" do
- knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'blah' is empty or entirely chefignored at #{Chef::Config.cookbook_path[0]}/blah\n")
+ knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, stderr: "WARN: Cookbook 'blah' is empty or entirely chefignored at #{Chef::Config.cookbook_path[0]}/blah\n")
/cookbooks/blah/
/cookbooks/blah/metadata.rb
/cookbooks/cookbook1/
@@ -408,7 +408,7 @@ EOM
file "cookbooks2/blah/metadata.rb", ""
end
it "knife list -Rfp cookbooks shows files in the first cookbook and not the second" do
- knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, :stderr => "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.cookbook_path[0]}/blah and #{Chef::Config.cookbook_path[1]}/blah\n")
+ knife("list --local -Rfp /cookbooks").should_succeed(<<EOM, stderr: "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.cookbook_path[0]}/blah and #{Chef::Config.cookbook_path[1]}/blah\n")
/cookbooks/blah/
/cookbooks/blah/metadata.json
/cookbooks/cookbook1/
@@ -442,7 +442,7 @@ EOM
file "data_bags2/blah/item2.json", ""
end
it "knife list -Rfp data_bags shows only items in data_bags1" do
- knife("list --local -Rfp /data_bags").should_succeed(<<EOM, :stderr => "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.data_bag_path[0]}/blah and #{Chef::Config.data_bag_path[1]}/blah\n")
+ knife("list --local -Rfp /data_bags").should_succeed(<<EOM, stderr: "WARN: Child with name 'blah' found in multiple directories: #{Chef::Config.data_bag_path[0]}/blah and #{Chef::Config.data_bag_path[1]}/blah\n")
/data_bags/bag/
/data_bags/bag/item.json
/data_bags/bag2/
diff --git a/spec/integration/knife/chef_repository_file_system_spec.rb b/spec/integration/knife/chef_repository_file_system_spec.rb
index 222d3aee8a..c9aa787bbe 100644
--- a/spec/integration/knife/chef_repository_file_system_spec.rb
+++ b/spec/integration/knife/chef_repository_file_system_spec.rb
@@ -53,7 +53,7 @@ EOM
before { directory "cookbooks/cookbook1" }
it "knife list --local -Rfp / does not return it" do
- knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
+ knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
/cookbooks/
EOM
end
@@ -63,7 +63,7 @@ EOM
before { directory "cookbooks/cookbook1/recipes" }
it "knife list --local -Rfp / does not return it" do
- knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
+ knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
/cookbooks/
EOM
end
@@ -90,7 +90,7 @@ EOM
before { directory "cookbooks/cookbook1/templates/default" }
it "knife list --local -Rfp / does not return it" do
- knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
+ knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
/cookbooks/
EOM
end
diff --git a/spec/integration/knife/chefignore_spec.rb b/spec/integration/knife/chefignore_spec.rb
index aa5a3979cc..e3f1e18f7e 100644
--- a/spec/integration/knife/chefignore_spec.rb
+++ b/spec/integration/knife/chefignore_spec.rb
@@ -69,7 +69,7 @@ EOM
end
it "the cookbook is not listed" do
- knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
+ knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Cookbook 'cookbook1' is empty or entirely chefignored at #{Chef::Config.chef_repo_path}/cookbooks/cookbook1\n")
/cookbooks/
EOM
end
@@ -251,7 +251,7 @@ EOM
end
it "chefignores apply only to the winning cookbook" do
- knife("list --local -Rfp /").should_succeed(<<EOM, :stderr => "WARN: Child with name 'yourcookbook' found in multiple directories: #{Chef::Config.chef_repo_path}/cookbooks1/yourcookbook and #{Chef::Config.chef_repo_path}/cookbooks2/yourcookbook\n")
+ knife("list --local -Rfp /").should_succeed(<<EOM, stderr: "WARN: Child with name 'yourcookbook' found in multiple directories: #{Chef::Config.chef_repo_path}/cookbooks1/yourcookbook and #{Chef::Config.chef_repo_path}/cookbooks2/yourcookbook\n")
/cookbooks/
/cookbooks/mycookbook/
/cookbooks/mycookbook/x.json
diff --git a/spec/integration/knife/common_options_spec.rb b/spec/integration/knife/common_options_spec.rb
index da1409456b..0b090f170e 100644
--- a/spec/integration/knife/common_options_spec.rb
+++ b/spec/integration/knife/common_options_spec.rb
@@ -125,7 +125,7 @@ EOM
context "when the default port (8889) is already bound" do
before :each do
begin
- @server = ChefZero::Server.new(:host => "localhost", :port => 8889)
+ @server = ChefZero::Server.new(host: "localhost", port: 8889)
@server.start_background
rescue Errno::EADDRINUSE
# OK. Don't care who has it in use, as long as *someone* does.
@@ -144,7 +144,7 @@ EOM
context "when port 9999 is already bound" do
before :each do
begin
- @server = ChefZero::Server.new(:host => "localhost", :port => 9999)
+ @server = ChefZero::Server.new(host: "localhost", port: 9999)
@server.start_background
rescue Errno::EADDRINUSE
# OK. Don't care who has it in use, as long as *someone* does.
diff --git a/spec/integration/knife/cookbook_api_ipv6_spec.rb b/spec/integration/knife/cookbook_api_ipv6_spec.rb
index 0a4a6a6e94..434210c01e 100644
--- a/spec/integration/knife/cookbook_api_ipv6_spec.rb
+++ b/spec/integration/knife/cookbook_api_ipv6_spec.rb
@@ -23,7 +23,7 @@ describe "Knife cookbook API integration with IPv6", :workstation, :not_supporte
include Chef::Mixin::ShellOut
when_the_chef_server "is bound to IPv6" do
- let(:chef_zero_opts) { { :host => "::1" } }
+ let(:chef_zero_opts) { { host: "::1" } }
let(:client_key) do
<<-END_VALIDATION_PEM
@@ -89,7 +89,7 @@ END_CLIENT_RB
end
it "successfully uploads a cookbook" do
- shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", :cwd => chef_dir)
+ shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", cwd: chef_dir)
versions_list_json = Chef::HTTP::Simple.new("http://[::1]:8900").get("/cookbooks/apache2", "accept" => "application/json")
versions_list = Chef::JSONCompat.from_json(versions_list_json)
expect(versions_list["apache2"]["versions"]).not_to be_empty
@@ -97,11 +97,11 @@ END_CLIENT_RB
context "and the cookbook has been uploaded to the server" do
before do
- shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", :cwd => chef_dir)
+ shell_out!("#{knife} cookbook upload apache2 #{knife_config_flag}", cwd: chef_dir)
end
it "downloads the cookbook" do
- shell_out!("knife cookbook download apache2 #{knife_config_flag} -d #{cache_path}", :cwd => chef_dir)
+ shell_out!("knife cookbook download apache2 #{knife_config_flag} -d #{cache_path}", cwd: chef_dir)
expect(Dir["#{cache_path}/*"].map { |entry| File.basename(entry) }).to include("apache2-0.0.1")
end
end
diff --git a/spec/integration/knife/delete_spec.rb b/spec/integration/knife/delete_spec.rb
index 1c69fbf9c9..9e0b46fd81 100644
--- a/spec/integration/knife/delete_spec.rb
+++ b/spec/integration/knife/delete_spec.rb
@@ -413,7 +413,7 @@ EOM
end
it "knife delete --both /environments/_default.json fails but still deletes the local copy" do
- knife("delete --both /environments/_default.json").should_fail :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", :stdout => "Deleted /environments/_default.json\n"
+ knife("delete --both /environments/_default.json").should_fail stderr: "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", stdout: "Deleted /environments/_default.json\n"
knife("list -Rf /").should_succeed server_everything
knife("list -Rf --local /").should_succeed <<EOM
/clients
@@ -600,7 +600,7 @@ EOM
end
it "knife delete --both /environments/_default.json fails" do
- knife("delete --both /environments/_default.json").should_fail "", :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n"
+ knife("delete --both /environments/_default.json").should_fail "", stderr: "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n"
knife("list -Rf /").should_succeed server_everything
knife("list -Rf --local /").should_succeed nothing
end
@@ -643,7 +643,7 @@ EOM
context "and cwd is at the top level" do
before { cwd "." }
it "knife delete fails" do
- knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", :stdout => /USAGE/
+ knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", stdout: /USAGE/
knife("list -Rf /").should_succeed <<EOM
clients
clients/chef-validator.json
@@ -796,7 +796,7 @@ EOM
end
it "knife delete --both /environments/_default.json fails but still deletes the local copy" do
- knife("delete --both /environments/_default.json").should_fail :stderr => "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", :stdout => "Deleted /environments/_default.json\n"
+ knife("delete --both /environments/_default.json").should_fail stderr: "ERROR: /environments/_default.json (remote) cannot be deleted (default environment cannot be modified).\n", stdout: "Deleted /environments/_default.json\n"
knife("list -Rf /").should_succeed server_nothing
knife("list -Rf --local /").should_succeed <<EOM
/clients
@@ -856,7 +856,7 @@ EOM
context "and cwd is at the top level" do
before { cwd "." }
it "knife delete fails" do
- knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", :stdout => /USAGE/
+ knife("delete").should_fail "FATAL: You must specify at least one argument. If you want to delete everything in this directory, run \"knife delete --recurse .\"\n", stdout: /USAGE/
knife("list -Rf /").should_succeed <<EOM
clients
clients/chef-validator.json
@@ -962,7 +962,7 @@ EOM
end
end
- when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do
+ when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do
before do
organization "foo" do
container "x", {}
diff --git a/spec/integration/knife/deps_spec.rb b/spec/integration/knife/deps_spec.rb
index 3f200396ba..b8ab6e719c 100644
--- a/spec/integration/knife/deps_spec.rb
+++ b/spec/integration/knife/deps_spec.rb
@@ -252,44 +252,44 @@ EOM
when_the_repository "is empty" do
it "knife deps /blah reports an error" do
knife("deps /blah").should_fail(
- :exit_code => 2,
- :stdout => "/blah\n",
- :stderr => "ERROR: /blah: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/blah\n",
+ stderr: "ERROR: /blah: No such file or directory\n"
)
end
it "knife deps /roles/x.json reports an error" do
knife("deps /roles/x.json").should_fail(
- :exit_code => 2,
- :stdout => "/roles/x.json\n",
- :stderr => "ERROR: /roles/x.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/roles/x.json\n",
+ stderr: "ERROR: /roles/x.json: No such file or directory\n"
)
end
it "knife deps /nodes/x.json reports an error" do
knife("deps /nodes/x.json").should_fail(
- :exit_code => 2,
- :stdout => "/nodes/x.json\n",
- :stderr => "ERROR: /nodes/x.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/nodes/x.json\n",
+ stderr: "ERROR: /nodes/x.json: No such file or directory\n"
)
end
it "knife deps /environments/x.json reports an error" do
knife("deps /environments/x.json").should_fail(
- :exit_code => 2,
- :stdout => "/environments/x.json\n",
- :stderr => "ERROR: /environments/x.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/environments/x.json\n",
+ stderr: "ERROR: /environments/x.json: No such file or directory\n"
)
end
it "knife deps /cookbooks/x reports an error" do
knife("deps /cookbooks/x").should_fail(
- :exit_code => 2,
- :stdout => "/cookbooks/x\n",
- :stderr => "ERROR: /cookbooks/x: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/cookbooks/x\n",
+ stderr: "ERROR: /cookbooks/x: No such file or directory\n"
)
end
it "knife deps /data_bags/bag/item.json reports an error" do
knife("deps /data_bags/bag/item.json").should_fail(
- :exit_code => 2,
- :stdout => "/data_bags/bag/item.json\n",
- :stderr => "ERROR: /data_bags/bag/item.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/data_bags/bag/item.json\n",
+ stderr: "ERROR: /data_bags/bag/item.json: No such file or directory\n"
)
end
end
@@ -299,9 +299,9 @@ EOM
end
it "knife deps reports the cookbook, along with an error" do
knife("deps /roles/starring.json").should_fail(
- :exit_code => 2,
- :stdout => "/cookbooks/quiche\n/roles/starring.json\n",
- :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/cookbooks/quiche\n/roles/starring.json\n",
+ stderr: "ERROR: /cookbooks/quiche: No such file or directory\n"
)
end
end
@@ -311,9 +311,9 @@ EOM
end
it "knife deps reports the environment, along with an error" do
knife("deps /nodes/mort.json").should_fail(
- :exit_code => 2,
- :stdout => "/environments/desert.json\n/nodes/mort.json\n",
- :stderr => "ERROR: /environments/desert.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/environments/desert.json\n/nodes/mort.json\n",
+ stderr: "ERROR: /environments/desert.json: No such file or directory\n"
)
end
end
@@ -323,9 +323,9 @@ EOM
end
it "knife deps reports the role, along with an error" do
knife("deps /roles/starring.json").should_fail(
- :exit_code => 2,
- :stdout => "/roles/minor.json\n/roles/starring.json\n",
- :stderr => "ERROR: /roles/minor.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/roles/minor.json\n/roles/starring.json\n",
+ stderr: "ERROR: /roles/minor.json: No such file or directory\n"
)
end
end
@@ -337,9 +337,9 @@ EOM
end
it "knife deps /roles reports an error" do
knife("deps /roles").should_fail(
- :exit_code => 2,
- :stderr => "ERROR: /roles: No such file or directory\n",
- :stdout => "/roles\n"
+ exit_code: 2,
+ stderr: "ERROR: /roles: No such file or directory\n",
+ stdout: "/roles\n"
)
end
end
@@ -590,44 +590,44 @@ EOM
when_the_chef_server "is empty" do
it "knife deps /blah reports an error" do
knife("deps --remote /blah").should_fail(
- :exit_code => 2,
- :stdout => "/blah\n",
- :stderr => "ERROR: /blah: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/blah\n",
+ stderr: "ERROR: /blah: No such file or directory\n"
)
end
it "knife deps /roles/x.json reports an error" do
knife("deps --remote /roles/x.json").should_fail(
- :exit_code => 2,
- :stdout => "/roles/x.json\n",
- :stderr => "ERROR: /roles/x.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/roles/x.json\n",
+ stderr: "ERROR: /roles/x.json: No such file or directory\n"
)
end
it "knife deps /nodes/x.json reports an error" do
knife("deps --remote /nodes/x.json").should_fail(
- :exit_code => 2,
- :stdout => "/nodes/x.json\n",
- :stderr => "ERROR: /nodes/x.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/nodes/x.json\n",
+ stderr: "ERROR: /nodes/x.json: No such file or directory\n"
)
end
it "knife deps /environments/x.json reports an error" do
knife("deps --remote /environments/x.json").should_fail(
- :exit_code => 2,
- :stdout => "/environments/x.json\n",
- :stderr => "ERROR: /environments/x.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/environments/x.json\n",
+ stderr: "ERROR: /environments/x.json: No such file or directory\n"
)
end
it "knife deps /cookbooks/x reports an error" do
knife("deps --remote /cookbooks/x").should_fail(
- :exit_code => 2,
- :stdout => "/cookbooks/x\n",
- :stderr => "ERROR: /cookbooks/x: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/cookbooks/x\n",
+ stderr: "ERROR: /cookbooks/x: No such file or directory\n"
)
end
it "knife deps /data_bags/bag/item reports an error" do
knife("deps --remote /data_bags/bag/item.json").should_fail(
- :exit_code => 2,
- :stdout => "/data_bags/bag/item.json\n",
- :stderr => "ERROR: /data_bags/bag/item.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/data_bags/bag/item.json\n",
+ stderr: "ERROR: /data_bags/bag/item.json: No such file or directory\n"
)
end
end
@@ -637,9 +637,9 @@ EOM
end
it "knife deps reports the cookbook, along with an error" do
knife("deps --remote /roles/starring.json").should_fail(
- :exit_code => 2,
- :stdout => "/cookbooks/quiche\n/roles/starring.json\n",
- :stderr => "ERROR: /cookbooks/quiche: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/cookbooks/quiche\n/roles/starring.json\n",
+ stderr: "ERROR: /cookbooks/quiche: No such file or directory\n"
)
end
end
@@ -649,9 +649,9 @@ EOM
end
it "knife deps reports the environment, along with an error" do
knife("deps --remote /nodes/mort.json").should_fail(
- :exit_code => 2,
- :stdout => "/environments/desert.json\n/nodes/mort.json\n",
- :stderr => "ERROR: /environments/desert.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/environments/desert.json\n/nodes/mort.json\n",
+ stderr: "ERROR: /environments/desert.json: No such file or directory\n"
)
end
end
@@ -661,9 +661,9 @@ EOM
end
it "knife deps reports the role, along with an error" do
knife("deps --remote /roles/starring.json").should_fail(
- :exit_code => 2,
- :stdout => "/roles/minor.json\n/roles/starring.json\n",
- :stderr => "ERROR: /roles/minor.json: No such file or directory\n"
+ exit_code: 2,
+ stdout: "/roles/minor.json\n/roles/starring.json\n",
+ stderr: "ERROR: /roles/minor.json: No such file or directory\n"
)
end
end
diff --git a/spec/integration/knife/diff_spec.rb b/spec/integration/knife/diff_spec.rb
index b3bd23f48e..839dcafe49 100644
--- a/spec/integration/knife/diff_spec.rb
+++ b/spec/integration/knife/diff_spec.rb
@@ -247,7 +247,7 @@ EOM
end
when_the_chef_server "has an environment with a different value" do
before { environment "x", { "description" => "hi" } }
- it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do
+ it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do
knife("diff /environments/x.json").should_succeed(/
{
- "name": "x",
@@ -277,7 +277,7 @@ EOM
environment "x", {}
end
- it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do
+ it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do
knife("diff /environments/x.json").should_succeed(/
{
- "name": "x"
@@ -291,7 +291,7 @@ EOM
before do
environment "x", { "description" => "lo" }
end
- it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do
+ it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do
knife("diff /environments/x.json").should_succeed(/
{
"name": "x",
@@ -311,7 +311,7 @@ EOM
it "knife diff reports an error and does a textual diff" do
error_text = "WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF"
error_match = Regexp.new(Regexp.escape(error_text))
- knife("diff /environments/x.json").should_succeed(/- "name": "x"/, :stderr => error_match)
+ knife("diff /environments/x.json").should_succeed(/- "name": "x"/, stderr: error_match)
end
end
end
@@ -533,7 +533,7 @@ EOM
end
when_the_chef_server "has an environment with a different value" do
before { environment "x", { "description" => "hi" } }
- it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do
+ it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do
knife("diff /environments/x.json").should_succeed(/
{
- "name": "x",
@@ -560,7 +560,7 @@ EOM
end
when_the_chef_server "has an environment with no value" do
before { environment "x", {} }
- it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do
+ it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do
knife("diff /environments/x.json").should_succeed(/
{
- "name": "x"
@@ -574,7 +574,7 @@ EOM
before do
environment "x", { "description" => "lo" }
end
- it "knife diff reports the difference", :skip => (RUBY_VERSION < "1.9") do
+ it "knife diff reports the difference", skip: (RUBY_VERSION < "1.9") do
knife("diff /environments/x.json").should_succeed(/
{
"name": "x",
@@ -594,7 +594,7 @@ EOM
it "knife diff reports an error and does a textual diff" do
error_text = "WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error: premature EOF"
error_match = Regexp.new(Regexp.escape(error_text))
- knife("diff /environments/x.json").should_succeed(/- "name": "x"/, :stderr => error_match)
+ knife("diff /environments/x.json").should_succeed(/- "name": "x"/, stderr: error_match)
end
end
end
diff --git a/spec/integration/knife/download_spec.rb b/spec/integration/knife/download_spec.rb
index be0fc9d708..68762ec58e 100644
--- a/spec/integration/knife/download_spec.rb
+++ b/spec/integration/knife/download_spec.rb
@@ -255,7 +255,7 @@ EOM
end
it "knife download with no parameters reports an error" do
- knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/
+ knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/
end
end
end
@@ -383,7 +383,7 @@ EOM
cwd "data_bags"
end
it "knife download fails" do
- knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/
+ knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/
end
it "knife download --purge . downloads everything" do
knife("download --purge .").should_succeed <<EOM
@@ -545,7 +545,7 @@ EOM
end
it "knife download refuses to change the role" do
- knife("download /roles/x.json").should_succeed "", :stderr => "WARNING: /roles/x.rb cannot be updated (can't safely update ruby files).\n"
+ knife("download /roles/x.json").should_succeed "", stderr: "WARNING: /roles/x.rb cannot be updated (can't safely update ruby files).\n"
knife("diff --name-status /roles/x.json").should_succeed "M\t/roles/x.rb\n"
end
end
@@ -566,7 +566,7 @@ WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error
(right here) ------^
EOH
- knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n", :stderr => warning
+ knife("download /environments/x.json").should_succeed "Updated /environments/x.json\n", stderr: warning
knife("diff --name-status /environments/x.json").should_succeed ""
end
end
@@ -779,7 +779,7 @@ EOM
cwd "."
end
it "knife download with no parameters reports an error" do
- knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/
+ knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/
end
end
end
@@ -898,7 +898,7 @@ EOM
cwd "data_bags"
end
it "knife download fails" do
- knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", :stdout => /USAGE/
+ knife("download").should_fail "FATAL: You must specify at least one argument. If you want to download everything in this directory, run \"knife download .\"\n", stdout: /USAGE/
end
it "knife download --purge . downloads everything" do
knife("download --purge .").should_succeed <<EOM
@@ -1111,7 +1111,7 @@ EOM
end
end
- when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do
+ when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do
before do
user "foo", {}
user "bar", {}
diff --git a/spec/integration/knife/list_spec.rb b/spec/integration/knife/list_spec.rb
index 4aa74f3f0e..bcafd40e9b 100644
--- a/spec/integration/knife/list_spec.rb
+++ b/spec/integration/knife/list_spec.rb
@@ -466,7 +466,7 @@ EOM
end
end
- when_the_repository "has a cookbooks directory and a symlinked cookbooks directory", :skip => (Chef::Platform.windows?) do
+ when_the_repository "has a cookbooks directory and a symlinked cookbooks directory", skip: (Chef::Platform.windows?) do
before do
directory "cookbooks"
symlink "symlinked", "cookbooks"
@@ -503,7 +503,7 @@ EOM
end
end
- when_the_repository "has a real_cookbooks directory and a cookbooks symlink to it", :skip => (Chef::Platform.windows?) do
+ when_the_repository "has a real_cookbooks directory and a cookbooks symlink to it", skip: (Chef::Platform.windows?) do
before do
directory "real_cookbooks"
symlink "cookbooks", "real_cookbooks"
@@ -638,7 +638,7 @@ EOM
end
end
- when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do
+ when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do
before do
organization "foo"
end
diff --git a/spec/integration/knife/raw_spec.rb b/spec/integration/knife/raw_spec.rb
index 5e0d3a3d11..27e425717b 100644
--- a/spec/integration/knife/raw_spec.rb
+++ b/spec/integration/knife/raw_spec.rb
@@ -38,7 +38,7 @@ describe "knife raw", :workstation do
user "x", "{}"
end
- it "knife raw /nodes/x returns the node", :skip => (RUBY_VERSION < "1.9") do
+ it "knife raw /nodes/x returns the node", skip: (RUBY_VERSION < "1.9") do
knife("raw /nodes/x").should_succeed <<EOM
{
"name": "x",
@@ -70,7 +70,7 @@ EOM
knife("raw /blarghle").should_fail(/ERROR: Server responded with error 404 "Not Found\s*"/)
end
- it "knife raw -m DELETE /roles/x succeeds", :skip => (RUBY_VERSION < "1.9") do
+ it "knife raw -m DELETE /roles/x succeeds", skip: (RUBY_VERSION < "1.9") do
knife("raw -m DELETE /roles/x").should_succeed <<EOM
{
"name": "x",
@@ -94,7 +94,7 @@ EOM
knife("show /roles/x.json").should_fail "ERROR: /roles/x.json: No such file or directory\n"
end
- it "knife raw -m PUT -i blah.txt /roles/x succeeds", :skip => (RUBY_VERSION < "1.9") do
+ it "knife raw -m PUT -i blah.txt /roles/x succeeds", skip: (RUBY_VERSION < "1.9") do
Tempfile.open("raw_put_input") do |file|
file.write <<EOM
{
@@ -148,7 +148,7 @@ EOM
end
end
- it "knife raw -m POST -i blah.txt /roles succeeds", :skip => (RUBY_VERSION < "1.9") do
+ it "knife raw -m POST -i blah.txt /roles succeeds", skip: (RUBY_VERSION < "1.9") do
Tempfile.open("raw_put_input") do |file|
file.write <<EOM
{
@@ -198,7 +198,7 @@ EOM
@raw_server_thread.kill if @raw_server_thread
end
- it "knife raw /blah returns the prettified json", :skip => (RUBY_VERSION < "1.9") do
+ it "knife raw /blah returns the prettified json", skip: (RUBY_VERSION < "1.9") do
knife("raw /blah").should_succeed <<EOM
{
"x": "y",
diff --git a/spec/integration/knife/show_spec.rb b/spec/integration/knife/show_spec.rb
index ed4802fef9..3d7dfe68e2 100644
--- a/spec/integration/knife/show_spec.rb
+++ b/spec/integration/knife/show_spec.rb
@@ -76,7 +76,7 @@ EOM
}
EOM
end
- it "knife show /environments/x.json shows the remote version", :skip => (RUBY_VERSION < "1.9") do
+ it "knife show /environments/x.json shows the remote version", skip: (RUBY_VERSION < "1.9") do
knife("show /environments/x.json").should_succeed <<EOM
/environments/x.json:
{
@@ -92,7 +92,7 @@ EOM
}
EOM
end
- it "knife show /roles/x.json shows the remote version", :skip => (RUBY_VERSION < "1.9") do
+ it "knife show /roles/x.json shows the remote version", skip: (RUBY_VERSION < "1.9") do
knife("show /roles/x.json").should_succeed <<EOM
/roles/x.json:
{
@@ -135,7 +135,7 @@ EOM
"name" => "x",
}
end
- it "knife show shows the attributes in a predetermined order", :skip => (RUBY_VERSION < "1.9") do
+ it "knife show shows the attributes in a predetermined order", skip: (RUBY_VERSION < "1.9") do
knife("show /environments/x.json").should_succeed <<EOM
/environments/x.json:
{
diff --git a/spec/integration/knife/upload_spec.rb b/spec/integration/knife/upload_spec.rb
index dc713d02b3..f478e6da01 100644
--- a/spec/integration/knife/upload_spec.rb
+++ b/spec/integration/knife/upload_spec.rb
@@ -68,7 +68,7 @@ EOM
end
it "knife upload --purge deletes everything" do
- knife("upload --purge /").should_succeed(<<EOM, :stderr => "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n")
+ knife("upload --purge /").should_succeed(<<EOM, stderr: "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n")
Deleted extra entry /clients/chef-validator.json (purge is on)
Deleted extra entry /clients/chef-webui.json (purge is on)
Deleted extra entry /clients/x.json (purge is on)
@@ -271,7 +271,7 @@ EOM
end
it "knife upload with no parameters reports an error" do
- knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/
+ knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/
end
end
end
@@ -291,7 +291,7 @@ Created /data_bags/x/y.json
EOM
knife("diff --name-status /data_bags").should_succeed <<EOM
EOM
- expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false).keys.sort).to eq(%w{foo id})
+ expect(Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, create_additions: false).keys.sort).to eq(%w{foo id})
end
it "knife upload /data_bags/x /data_bags/x/y.json uploads x once" do
@@ -314,7 +314,7 @@ Created /data_bags/x
Created /data_bags/x/y.json
EOM
knife("diff --name-status /data_bags").should_succeed ""
- result = Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, :create_additions => false)
+ result = Chef::JSONCompat.parse(knife("raw /data/x/y").stdout, create_additions: false)
expect(result.keys.sort).to eq(%w{chef_type data_bag id})
expect(result["chef_type"]).to eq("aaa")
expect(result["data_bag"]).to eq("bbb")
@@ -419,7 +419,7 @@ EOM
end
it "knife upload fails" do
- knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/
+ knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/
end
it "knife upload --purge . uploads everything" do
@@ -525,7 +525,7 @@ EOM
when_the_chef_server "has a frozen cookbook" do
before do
- cookbook "frozencook", "1.0.0", {}, :frozen => true
+ cookbook "frozencook", "1.0.0", {}, frozen: true
end
when_the_repository "has an update to said cookbook" do
@@ -652,7 +652,7 @@ WARN: Parse error reading #{path_to('environments/x.json')} as JSON: parse error
EOH
knife("upload /environments/x.json").should_fail(error1)
- knife("diff --name-status /environments/x.json").should_succeed("M\t/environments/x.json\n", :stderr => warn)
+ knife("diff --name-status /environments/x.json").should_succeed("M\t/environments/x.json\n", stderr: warn)
end
end
@@ -767,7 +767,7 @@ EOM
end
it "knife upload --purge deletes everything" do
- knife("upload --purge /").should_succeed(<<EOM, :stderr => "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n")
+ knife("upload --purge /").should_succeed(<<EOM, stderr: "WARNING: /environments/_default.json cannot be deleted (default environment cannot be modified).\n")
Deleted extra entry /clients/chef-validator.json (purge is on)
Deleted extra entry /clients/chef-webui.json (purge is on)
Deleted extra entry /clients/x.json (purge is on)
@@ -922,7 +922,7 @@ EOM
cwd "."
end
it "knife upload with no parameters reports an error" do
- knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/
+ knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/
end
end
end
@@ -1024,7 +1024,7 @@ EOM
cwd "data_bags"
end
it "knife upload fails" do
- knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", :stdout => /USAGE/
+ knife("upload").should_fail "FATAL: You must specify at least one argument. If you want to upload everything in this directory, run \"knife upload .\"\n", stdout: /USAGE/
end
it "knife upload --purge . uploads everything" do
knife("upload --purge .").should_succeed <<EOM
@@ -1274,7 +1274,7 @@ EOM
end
end
- when_the_chef_server "is in Enterprise mode", :osc_compat => false, :single_org => false do
+ when_the_chef_server "is in Enterprise mode", osc_compat: false, single_org: false do
before do
user "foo", {}
user "bar", {}
@@ -1472,7 +1472,7 @@ EOM
end
it "knife upload / emits a warning for bar and invites foobar" do
- knife("upload /").should_succeed "Updated /invitations.json\n", :stderr => "WARN: Could not invite bar to organization foo: User bar is already in organization foo\n"
+ knife("upload /").should_succeed "Updated /invitations.json\n", stderr: "WARN: Could not invite bar to organization foo: User bar is already in organization foo\n"
expect(api.get("association_requests").map { |a| a["username"] }).to eq(%w{foo foobar})
expect(api.get("users").map { |a| a["user"]["username"] }).to eq([ "bar" ])
end