summaryrefslogtreecommitdiff
path: root/spec/unit/knife
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-01-15 13:07:58 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2019-01-15 13:07:58 -0800
commit990974ca5cd44df0c77bb6a12fc57a3c32b92e23 (patch)
tree5779719f58254764e57eb9cacde85837295fd2f6 /spec/unit/knife
parent4be1ebe66460efb0535e500d6ecb52a147346519 (diff)
downloadchef-990974ca5cd44df0c77bb6a12fc57a3c32b92e23.tar.gz
changes for rubocop engine upgrades.lcg/rubocop-upgrades
this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/knife')
-rw-r--r--spec/unit/knife/cookbook_upload_spec.rb4
-rw-r--r--spec/unit/knife/core/bootstrap_context_spec.rb2
-rw-r--r--spec/unit/knife/core/cookbook_scm_repo_spec.rb4
-rw-r--r--spec/unit/knife/core/node_editor_spec.rb8
-rw-r--r--spec/unit/knife/core/ui_spec.rb22
-rw-r--r--spec/unit/knife/ssl_check_spec.rb8
-rw-r--r--spec/unit/knife/ssl_fetch_spec.rb10
-rw-r--r--spec/unit/knife/supermarket_download_spec.rb8
8 files changed, 33 insertions, 33 deletions
diff --git a/spec/unit/knife/cookbook_upload_spec.rb b/spec/unit/knife/cookbook_upload_spec.rb
index ba0d57c5d6..8bff31197c 100644
--- a/spec/unit/knife/cookbook_upload_spec.rb
+++ b/spec/unit/knife/cookbook_upload_spec.rb
@@ -172,7 +172,7 @@ describe Chef::Knife::CookbookUpload do
before(:each) do
cookbook.metadata.depends("dependency")
allow(cookbook_loader).to receive(:[]) do |ckbk|
- { "test_cookbook" => cookbook,
+ { "test_cookbook" => cookbook,
"dependency" => cookbook_dependency }[ckbk]
end
allow(knife).to receive(:cookbook_names).and_return(%w{cookbook_dependency test_cookbook})
@@ -198,7 +198,7 @@ describe Chef::Knife::CookbookUpload do
cookbook_dependency2 = Chef::CookbookVersion.new("dependency2")
cookbook.metadata.depends("dependency2")
allow(cookbook_loader).to receive(:[]) do |ckbk|
- { "test_cookbook" => cookbook,
+ { "test_cookbook" => cookbook,
"dependency" => cookbook_dependency,
"dependency2" => cookbook_dependency2 }[ckbk]
end
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb
index bd48709a93..5aa176557f 100644
--- a/spec/unit/knife/core/bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/bootstrap_context_spec.rb
@@ -75,7 +75,7 @@ describe Chef::Knife::Core::BootstrapContext do
log_level :info
log_location "/tmp/log"
# Using default node name (fqdn)
-EXPECTED
+ EXPECTED
expect(bootstrap_context.config_content).to eq expected
end
diff --git a/spec/unit/knife/core/cookbook_scm_repo_spec.rb b/spec/unit/knife/core/cookbook_scm_repo_spec.rb
index a530dbcdaa..a72c184f19 100644
--- a/spec/unit/knife/core/cookbook_scm_repo_spec.rb
+++ b/spec/unit/knife/core/cookbook_scm_repo_spec.rb
@@ -35,7 +35,7 @@ describe Chef::Knife::CookbookSCMRepo do
chef-vendor-graphite
chef-vendor-python
chef-vendor-absent-new
-BRANCHES
+ BRANCHES
end
it "has a path to the cookbook repo" do
@@ -84,7 +84,7 @@ BRANCHES
@dirty_status = Mixlib::ShellOut.new
@dirty_status.stdout.replace(<<-DIRTY)
M chef/lib/chef/knife/cookbook_site_install.rb
-DIRTY
+ DIRTY
expect(@cookbook_repo).to receive(:shell_out!).with("git status --porcelain", cwd: @repo_path).and_return(@dirty_status)
expect { @cookbook_repo.sanity_check }.to raise_error(SystemExit)
end
diff --git a/spec/unit/knife/core/node_editor_spec.rb b/spec/unit/knife/core/node_editor_spec.rb
index a3dd63177d..ccf6776593 100644
--- a/spec/unit/knife/core/node_editor_spec.rb
+++ b/spec/unit/knife/core/node_editor_spec.rb
@@ -24,10 +24,10 @@ describe Chef::Knife::NodeEditor do
{ "name" => "test_node",
"chef_environment" => "production",
"automatic" => { "foo" => "bar" },
- "default" => { "alpha" => { "bravo" => "charlie", "delta" => "echo" } },
- "normal" => { "alpha" => { "bravo" => "hotel" }, "tags" => [] },
- "override" => { "alpha" => { "bravo" => "foxtrot", "delta" => "golf" } },
- "policy_name" => nil,
+ "default" => { "alpha" => { "bravo" => "charlie", "delta" => "echo" } },
+ "normal" => { "alpha" => { "bravo" => "hotel" }, "tags" => [] },
+ "override" => { "alpha" => { "bravo" => "foxtrot", "delta" => "golf" } },
+ "policy_name" => nil,
"policy_group" => nil,
"run_list" => %w{role[comedy] role[drama] recipe[mystery]},
}
diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb
index 025c1ecd91..e5f19a4837 100644
--- a/spec/unit/knife/core/ui_spec.rb
+++ b/spec/unit/knife/core/ui_spec.rb
@@ -214,7 +214,7 @@ describe Chef::Knife::UI do
expect(@out.string).to eq <<~EOM
hi: a
lo: b
-EOM
+ EOM
end
it "formats empty hashes appropriately" do
@@ -227,7 +227,7 @@ EOM
expect(@out.string).to eq <<~EOM
a
b
-EOM
+ EOM
end
it "formats empty arrays appropriately" do
@@ -253,7 +253,7 @@ EOM
c
d
-EOM
+ EOM
end
it "formats nested arrays with single- and empty subarrays appropriately" do
@@ -267,7 +267,7 @@ EOM
d
e
-EOM
+ EOM
end
it "formats arrays of hashes with extra lines in between for readability" do
@@ -280,7 +280,7 @@ EOM
m: n
o: p
-EOM
+ EOM
end
it "formats hashes with empty array members appropriately" do
@@ -288,7 +288,7 @@ EOM
expect(@out.string).to eq <<~EOM
a:
b: c
-EOM
+ EOM
end
it "formats hashes with single-member array values appropriately" do
@@ -296,7 +296,7 @@ EOM
expect(@out.string).to eq <<~EOM
a: foo
b: c
-EOM
+ EOM
end
it "formats hashes with array members appropriately" do
@@ -306,7 +306,7 @@ EOM
foo
bar
b: c
-EOM
+ EOM
end
it "formats hashes with single-member nested array values appropriately" do
@@ -315,7 +315,7 @@ EOM
a:
foo
b: c
-EOM
+ EOM
end
it "formats hashes with nested array values appropriately" do
@@ -332,7 +332,7 @@ EOM
aa: bb
cc: dd
b: c
-EOM
+ EOM
end
it "formats hashes with empty hash values appropriately" do
@@ -340,7 +340,7 @@ EOM
expect(@out.string).to eq <<~EOM
a:
b: c
-EOM
+ EOM
end
end
diff --git a/spec/unit/knife/ssl_check_spec.rb b/spec/unit/knife/ssl_check_spec.rb
index 9092110b95..58eae312f6 100644
--- a/spec/unit/knife/ssl_check_spec.rb
+++ b/spec/unit/knife/ssl_check_spec.rb
@@ -69,10 +69,10 @@ describe Chef::Knife::SslCheck do
expect { ssl_check.run }.to raise_error(SystemExit)
expected_stdout = <<~E
USAGE: knife ssl check [URL] (options)
-E
+ E
expected_stderr = <<~E
ERROR: Given URI: `foo.test' is invalid
-E
+ E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
end
@@ -85,10 +85,10 @@ E
expect { ssl_check.run }.to raise_error(SystemExit)
expected_stdout = <<~E
USAGE: knife ssl check [URL] (options)
-E
+ E
expected_stderr = <<~E
ERROR: Given URI: `#{name_args[0]}' is invalid
-E
+ E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
end
diff --git a/spec/unit/knife/ssl_fetch_spec.rb b/spec/unit/knife/ssl_fetch_spec.rb
index 45dd27ceec..fb904074b3 100644
--- a/spec/unit/knife/ssl_fetch_spec.rb
+++ b/spec/unit/knife/ssl_fetch_spec.rb
@@ -70,10 +70,10 @@ describe Chef::Knife::SslFetch do
expect { ssl_fetch.run }.to raise_error(SystemExit)
expected_stdout = <<~E
USAGE: knife ssl fetch [URL] (options)
-E
+ E
expected_stderr = <<~E
ERROR: Given URI: `foo.test' is invalid
-E
+ E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
end
@@ -86,10 +86,10 @@ E
expect { ssl_fetch.run }.to raise_error(SystemExit)
expected_stdout = <<~E
USAGE: knife ssl fetch [URL] (options)
-E
+ E
expected_stderr = <<~E
ERROR: Given URI: `#{name_args[0]}' is invalid
-E
+ E
expect(stdout_io.string).to eq(expected_stdout)
expect(stderr_io.string).to eq(expected_stderr)
end
@@ -190,7 +190,7 @@ E
expected_error_text = <<~ERROR_TEXT
ERROR: The service at the given URI (http://foo.example.com) does not accept SSL connections
ERROR: Perhaps you meant to connect to 'https://foo.example.com'?
-ERROR_TEXT
+ ERROR_TEXT
run
expect(stderr).to include(expected_error_text)
diff --git a/spec/unit/knife/supermarket_download_spec.rb b/spec/unit/knife/supermarket_download_spec.rb
index 0332bd4390..71120007e3 100644
--- a/spec/unit/knife/supermarket_download_spec.rb
+++ b/spec/unit/knife/supermarket_download_spec.rb
@@ -31,8 +31,8 @@ describe Chef::Knife::SupermarketDownload do
@cookbook_api_url = "https://supermarket.chef.io/api/v1/cookbooks"
@version = "1.0.2"
@version_us = @version.tr ".", "_"
- @current_data = { "deprecated" => false,
- "latest_version" => "#{@cookbook_api_url}/apache2/versions/#{@version_us}",
+ @current_data = { "deprecated" => false,
+ "latest_version" => "#{@cookbook_api_url}/apache2/versions/#{@version_us}",
"replacement" => "other_apache2" }
allow(@knife.ui).to receive(:stderr).and_return(@stderr)
@@ -60,7 +60,7 @@ describe Chef::Knife::SupermarketDownload do
context "when" do
before do
@cookbook_data = { "version" => @version,
- "file" => "http://example.com/apache2_#{@version_us}.tgz" }
+ "file" => "http://example.com/apache2_#{@version_us}.tgz" }
@temp_file = double( path: "/tmp/apache2_#{@version_us}.tgz" )
@file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
end
@@ -125,7 +125,7 @@ describe Chef::Knife::SupermarketDownload do
@version = "1.0.1"
@version_us = @version.tr ".", "_"
@cookbook_data = { "version" => @version,
- "file" => "http://example.com/apache2_#{@version_us}.tgz" }
+ "file" => "http://example.com/apache2_#{@version_us}.tgz" }
@temp_file = double(path: "/tmp/apache2_#{@version_us}.tgz")
@file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz")
@knife.name_args << @version