Skip to content
This repository was archived by the owner on Jul 14, 2021. It is now read-only.

Improve chef --version command #2143

Merged
merged 3 commits into from
Jun 20, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
InSpec -> Chef InSpec
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Jun 20, 2019
commit 35b9a6954b48fdb980da22cb3f9d41d363571a03
4 changes: 2 additions & 2 deletions lib/chef-dk/cli.rb
Original file line number Diff line number Diff line change
@@ -97,10 +97,10 @@ def handle_options
def show_version
msg("Chef Development Kit Version: #{ChefDK::VERSION}")
{ "Chef Infra Client": "chef-client",
"Chef InSpec": "inspec",
"Test Kitchen": "kitchen",
"Foodcritic": "foodcritic",
"Cookstyle": "cookstyle",
"InSpec": "inspec",
"Cookstyle": "cookstyle"
}.each do |name, cli|
result = Bundler.with_clean_env { shell_out("#{cli} --version") }
if result.exitstatus != 0
10 changes: 5 additions & 5 deletions spec/unit/cli_spec.rb
Original file line number Diff line number Diff line change
@@ -131,6 +131,11 @@ def mock_shell_out(exitstatus, stdout, stderr)
"version_output" => "Chef Infra Client: 15.0.300",
"expected_version" => "15.0.300",
},
"Chef InSpec" => {
"command" => "inspec",
"version_output" => "4.6.2\n\nYour version of InSpec is out of date! The latest version is 4.6.4.",
"expected_version" => "4.6.2",
},
"Test Kitchen" => {
"command" => "kitchen",
"version_output" => "Test Kitchen version 2.2.5",
@@ -146,11 +151,6 @@ def mock_shell_out(exitstatus, stdout, stderr)
"version_output" => "Cookstyle 4.0.0\n * RuboCop 0.62.0",
"expected_version" => "4.0.0",
},
"InSpec" => {
"command" => "inspec",
"version_output" => "4.6.2\n\nYour version of InSpec is out of date! The latest version is 4.6.4.",
"expected_version" => "4.6.2",
},
}
end