summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2020-08-22 09:45:57 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2020-08-24 13:50:58 +0530
commitbc3b330a614449d496e0e204bc55197424f6c9b8 (patch)
tree6efe071132fad62c747a0c77959bac3347cca2ee
parentcbba43de4f64d82135427adb41ffcae686760eea (diff)
downloadchef-bc3b330a614449d496e0e204bc55197424f6c9b8.tar.gz
Fix failing specs
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r--lib/chef/knife/config_list_profiles.rb5
-rw-r--r--spec/integration/knife/config_list_profiles_spec.rb44
2 files changed, 24 insertions, 25 deletions
diff --git a/lib/chef/knife/config_list_profiles.rb b/lib/chef/knife/config_list_profiles.rb
index f8052e83e1..0b64ee6398 100644
--- a/lib/chef/knife/config_list_profiles.rb
+++ b/lib/chef/knife/config_list_profiles.rb
@@ -93,7 +93,7 @@ class Chef
private
- def render_table(profiles, padding: 2)
+ def render_table(profiles, padding: 1)
rows = []
# Render the data to a 2D array that will be used for the table.
profiles.each do |profile|
@@ -126,8 +126,7 @@ class Chef
else
table.render do |renderer|
renderer.border do
- mid "-"
- mid_mid " "
+ mid "-"
style :green
end
renderer.padding = [0, padding, 0, 0] # pad right with 2 characters
diff --git a/spec/integration/knife/config_list_profiles_spec.rb b/spec/integration/knife/config_list_profiles_spec.rb
index 0f4fd80498..28f6cb4ccb 100644
--- a/spec/integration/knife/config_list_profiles_spec.rb
+++ b/spec/integration/knife/config_list_profiles_spec.rb
@@ -82,9 +82,9 @@ describe "knife config list-profiles", :workstation do
chef_server_url = "https://example.com/organizations/testorg"
EOH
it { is_expected.to eq <<~EOH.delete("#") }
- Profile Client Key Server #
- ----------------------------------------------------------------------------------#
- *default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg#
+ Profile Client Key Server #
+ \e[32m--------------------------------------------------------------------------------\e[0m#
+ *default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
EOH
end
@@ -106,11 +106,11 @@ describe "knife config list-profiles", :workstation do
chef_server_url = "https://example.com/organizations/testorg"
EOH
it { is_expected.to eq <<~EOH.delete("#") }
- Profile Client Key Server #
- ----------------------------------------------------------------------------------#
- *default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg#
- prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
- qa qauser ~/src/qauser.pem https://example.com/organizations/testorg#
+ Profile Client Key Server #
+ \e[32m--------------------------------------------------------------------------------\e[0m#
+ *default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
+ prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
+ qa qauser ~/src/qauser.pem https://example.com/organizations/testorg #
EOH
end
@@ -133,11 +133,11 @@ describe "knife config list-profiles", :workstation do
chef_server_url = "https://example.com/organizations/testorg"
EOH
it { is_expected.to eq <<~EOH.delete("#") }
- Profile Client Key Server #
- ----------------------------------------------------------------------------------#
- default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg#
- *prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
- qa qauser ~/src/qauser.pem https://example.com/organizations/testorg#
+ Profile Client Key Server #
+ \e[32m--------------------------------------------------------------------------------\e[0m#
+ default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
+ *prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
+ qa qauser ~/src/qauser.pem https://example.com/organizations/testorg #
EOH
end
@@ -160,11 +160,11 @@ describe "knife config list-profiles", :workstation do
chef_server_url = "https://example.com/organizations/testorg"
EOH
it { is_expected.to eq <<~EOH.delete("#") }
- Profile Client Key Server #
- ---------------------------------------------------------------------------------#
- default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg#
- prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
- qa qauser ~/src/qauser.pem https://example.com/organizations/testorg#
+ Profile Client Key Server #
+ \e[32m--------------------------------------------------------------------------------\e[0m#
+ default testuser ~/.chef/testkey.pem https://example.com/organizations/testorg #
+ prod testuser ~/.chef/testkey.pem https://example.com/organizations/prod #
+ qa qauser ~/src/qauser.pem https://example.com/organizations/testorg #
EOH
end
@@ -173,7 +173,7 @@ describe "knife config list-profiles", :workstation do
[default]
chef_server_url = "https://example.com/organizations/testorg"
EOH
- it { is_expected.to match %r{^*default .*? https://example.com/organizations/testorg$} }
+ it { is_expected.to match %r{^*default .*? https://example.com/organizations/testorg} }
end
context "with -i" do
@@ -183,9 +183,9 @@ describe "knife config list-profiles", :workstation do
chef_server_url = "https://example.com/organizations/testorg"
EOH
it { is_expected.to eq <<~EOH.delete("#") }
- Profile Client Key Server #
- ----------------------------------------------------------------#
- *default https://example.com/organizations/testorg#
+ Profile Client Key Server #
+ \e[32m--------------------------------------------------------------\e[0m#
+ *default https://example.com/organizations/testorg #
EOH
end