diff --git a/.gitignore b/.gitignore index baf4d8b42d..00cae30980 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ .vagrant *.log coverage/ +pkg/ +*.swap # Chef Workstation is the source of truth for all locked gems Gemfile.lock diff --git a/chef-apply.gemspec b/chef-apply.gemspec index bb4e6f37f8..d66870dbb8 100644 --- a/chef-apply.gemspec +++ b/chef-apply.gemspec @@ -40,14 +40,14 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_dependency "mixlib-cli" # Provides argument handling DSL for CLI applications - spec.add_dependency "mixlib-config", ">= 3.0.5" # shared chef configuration library that - # simplifies managing a configuration file + spec.add_dependency "mixlib-config", ">= 3.0.5" # shared chef configuration library that + # simplifies managing a configuration file spec.add_dependency "mixlib-log" # Basis for our traditional logger spec.add_dependency "mixlib-install" # URL resolver + install tool for chef products spec.add_dependency "r18n-desktop" # easy path to message text management via - # localization gem... + # localization gem... spec.add_dependency "toml-rb" # This isn't ideal because mixlib-config uses 'tomlrb' - # but that library does not support a dumper + # but that library does not support a dumper spec.add_dependency "train-core", "~> 3.0" # remote connection management over ssh, winrm spec.add_dependency "train-winrm" # winrm transports were pulled out into this plugin spec.add_dependency "pastel" # A color library diff --git a/i18n/en.yml b/i18n/en.yml index 6d7028e532..4bd4f3cde6 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -18,11 +18,11 @@ cli: telemetry_enabled: | Telemetry has been enabled by default for this beta release - of chef-run. The anonymous data we gather is used to - determine how we can impove your chef-run experience. + of %1. The anonymous data we gather is used to + determine how we can impove your %2 experience. To disable it, add the following entry to - %1: + %2: [telemetry] enabled=false @@ -31,7 +31,7 @@ cli: options, visit https://chef.sh/docs/chef-workstation/privacy/ description: | - Chef Run is a tool to execute ad-hoc tasks using Chef. + %1 is a tool to execute ad-hoc tasks using %2. creating_config: "Creating config file in %1." default_config_location: "Location of config file. Default: %1" identity_file: "SSH identity file to use when connecting. Keys loaded into ssh-agent will also be used." @@ -44,9 +44,9 @@ cli: Current default: %1 cookbook_repo_paths: "Comma separated list of cookbook repository paths." install_description: | - Install Chef client on the target host(s) if it is not installed. + Install %1 on the target host(s) if it is not installed. This defaults to enabled - the installation will be performed - if there is no Chef client on the target(s). + if there is no %1 installation on the target(s). user_description: | Username to use for authentication to the target(s). The same username will be used for all targets. @@ -69,47 +69,47 @@ cli: password is required for sudo on the target(s). The same sudo password will be used for all targets. help: - description: Show help and usage for `chef-run` + description: Show help and usage for `%1` usage: | - chef-run [PROPERTIES] [FLAGS] - chef-run [FLAGS] + %1 [PROPERTIES] [FLAGS] + %1 [FLAGS] usage_full: | - chef-run [PROPERTIES] [FLAGS] + %1 [PROPERTIES] [FLAGS] Runs a single on the specified . [PROPERTIES] should be specified as key=value. For example: - chef-run web01 service nginx action=restart - chef-run web01,web02 service nginx action=restart - chef-run web0[1:2] service nginx action=restart + %1 web01 service nginx action=restart + %1 web01,web02 service nginx action=restart + %1 web0[1:2] service nginx action=restart - chef-run [FLAGS] + %1 [FLAGS] Runs a single recipe located at on the specified . For example: - chef-run web01 path/to/cookbook/recipe.rb - chef-run web01,web02 path/to/cookbook - chef-run web0[1:2] cookbook_name - chef-run web01 cookbook_name::recipe_name + %1 web01 path/to/cookbook/recipe.rb + %1 web01,web02 path/to/cookbook + %1 web0[1:2] cookbook_name + %1 web01 cookbook_name::recipe_name ARGUMENTS: The hosts or IPs to target. Can also be an SSH or WinRM URLs in the form: ssh://[USERNAME]@example.com[:PORT] - A Chef resource, such as 'user' or 'package' + A %2 resource, such as 'user' or 'package' The name, usually used to specify what 'thing' to set up with the resource. For example, given resource 'user', 'name' would be the name of the user you wanted to create. The recipe to converge. This can be provided as one of: 1. Full path to a recipe file 2. Cookbook name. First we check the working directory for this - cookbook, then we check in the chef repository path. If a + cookbook, then we check in the %3 repository path. If a cookbook is found we run the default recipe. 3. This behaves similarly to 'cookbook name' above, but it also allows you to specify which recipe to use from the cookbook. @@ -125,10 +125,10 @@ cli: Missing configuration file. - Please provide the path to a valid chef-run configuration file + Please provide the path to a valid %1 configuration file as an argument to --config-path. For example: - --config-path /home/user1/.chef-workstation/config.toml + --config-path /home/user1/%2/config.toml invalid_config_key: | @@ -152,18 +152,18 @@ cli: unsupported_installation: | - Use of chef-run within ChefDK is not supported. + Use of %1 within %2 is not supported. - Chef Workstation is the successor to the ChefDK, and contains the - same components including a supported chef-run. + %3 is the successor to the %2, and contains the + same components including a supported %1. Download the latest here: - https://downloads.chef.io/chef-workstation/stable + https://%4/chef-workstation/stable version: description: Show the current version of Chef Run. - show: "chef-run: %1" + show: "%1: %2" status: connecting: "Connecting as %1..." connected: "Connected." @@ -178,16 +178,16 @@ status: exporting: Generating local policyfile... exporting... success: Generating local policyfile... exporting... done! install_chef: - checking_for_client: Checking for Chef client. - verifying: Verifying Chef client installation. - downloading: Downloading Chef client installer into local cache. - uploading: Uploading Chef client installer to target. - installing: Installing Chef client version %1. - upgrading: Upgrading Chef client from version %1 to %2. - already_present: Chef client version %1 already installed on target. - install_success: Successfully installed Chef client version %1 - upgrade_success: Successfully upgraded Chef client from version %1 to %2. - failure: "An error occurred while installing Chef client: %1" + checking_for_client: Checking for Chef client. # Not currently in use + verifying: Verifying %1 client installation. + downloading: Downloading %1 client installer into local cache. + uploading: Uploading %1 client installer to target. + installing: Installing %1 client version %2. + upgrading: Upgrading %1 client from version %2 to %3. + already_present: "%1 client version %2 already installed on target." + install_success: Successfully installed %1 client version %2 + upgrade_success: Successfully upgraded %1 client from version %2 to %3. + failure: "An error occurred while installing Chef client: %1" # Not currently in use converge: header: !!pl 1: Applying %2 from %3 to target. diff --git a/i18n/errors/en.yml b/i18n/errors/en.yml index 69cdba516e..054112c148 100644 --- a/i18n/errors/en.yml +++ b/i18n/errors/en.yml @@ -69,25 +69,25 @@ errors: # Installer action errors CHEFINS002: text: | - The target does not have chef-client installed. + The target does not have %1 installed. - This command is powered by the Chef client. In order to make use of it - on this node, the Chef client must be installed first. + This command is powered by the %2 client. In order to make use of it + on this node, the %2 client must be installed first. Re-running this command without the '--no-install' flag will automatically perform the installation. CHEFINS003: | - The target's installed version of Chef Client is too old. + The target's installed version of %1 Client is too old. - Version %1 is installed, but this command requires a - minimum version of %2 (Chef 13) or %3 (Chef 14). + Version %2 is installed, but this command requires a + minimum version of %3 (%1 13) or %4 (%1 14). CHEFINS004: | - The target's installed version of Chef Client is too old. + The target's installed version of %1 Client is too old. - Version %1 is installed, but this command requires a - minimum version of %2. + Version %2 is installed, but this command requires a + minimum version of %3. CHEFINS003: text: | @@ -161,7 +161,7 @@ errors: CHEFCCR005: text: | - '%1' is not a valid Chef resource. + '%1' is not a valid resource. Please consult the documentation for a list of valid resources: diff --git a/lib/chef_apply/action/converge_target.rb b/lib/chef_apply/action/converge_target.rb index 56e1c62c4d..1ba504a15e 100644 --- a/lib/chef_apply/action/converge_target.rb +++ b/lib/chef_apply/action/converge_target.rb @@ -21,6 +21,8 @@ # FLAG: require "chef/util/path_helper" require "chef/util/path_helper" +require_relative "../dist" + module ChefApply::Action class ConvergeTarget < Base @@ -105,7 +107,7 @@ def create_remote_config(dir) data_collector.server_url "#{dc.url}" data_collector.token "#{dc.token}" data_collector.mode :solo - data_collector.organization "Chef Workstation" + data_collector.organization "#{ChefApply::Dist::WORKSTATION}" EOM end @@ -172,7 +174,7 @@ def handle_ccr_error # stale stacktrace. target_host.del_file(chef_report_path) report = JSON.parse(content) - ChefApply::Log.error("Remote chef-client error follows:") + ChefApply::Log.error("Remote #{ChefApply::Dist::CLIENT} error follows:") ChefApply::Log.error(report["exception"]) end mapper = ConvergeTarget::CCRFailureMapper.new(report["exception"], mapper_opts) @@ -191,14 +193,14 @@ def run_chef_cmd(working_dir, config_file, policy) when :windows "Set-Location -Path #{working_dir}; " + # We must 'wait' for chef-client to finish before changing directories and Out-Null does that - "chef-client -z --config #{File.join(working_dir, config_file)} --recipe-url #{File.join(working_dir, policy)} | Out-Null; " + + "#{ChefApply::Dist::CLIENT} -z --config #{File.join(working_dir, config_file)} --recipe-url #{File.join(working_dir, policy)} | Out-Null; " + # We have to leave working dir so we don't hold a lock on it, which allows us to delete this tempdir later "Set-Location C:/; " + "exit $LASTEXITCODE" else # cd is shell a builtin, so we'll invoke bash. This also means all commands are executed # with sudo (as long as we are hardcoding our sudo use) - "bash -c 'cd #{working_dir}; chef-client -z --config #{File.join(working_dir, config_file)} --recipe-url #{File.join(working_dir, policy)}'" + "bash -c 'cd #{working_dir}; #{ChefApply::Dist::CLIENT} -z --config #{File.join(working_dir, config_file)} --recipe-url #{File.join(working_dir, policy)}'" end end diff --git a/lib/chef_apply/action/install_chef/minimum_chef_version.rb b/lib/chef_apply/action/install_chef/minimum_chef_version.rb index 8e35323c6e..c3ffa8c357 100644 --- a/lib/chef_apply/action/install_chef/minimum_chef_version.rb +++ b/lib/chef_apply/action/install_chef/minimum_chef_version.rb @@ -17,12 +17,14 @@ require_relative "../../error" require_relative "minimum_chef_version" +require_relative "../../dist" module ChefApply module Action class InstallChef < Base class MinimumChefVersion + D = ChefApply::Dist CONSTRAINTS = { windows: { 13 => Gem::Version.new("13.10.4"), @@ -65,18 +67,18 @@ def self.check!(target, check_only) end class ClientNotInstalled < ChefApply::ErrorNoLogs - def initialize(); super("CHEFINS002"); end + def initialize(); super("CHEFINS002", D::CLIENT, D::SHORT); end end class Client13Outdated < ChefApply::ErrorNoLogs def initialize(current_version, min_13_version, min_14_version) - super("CHEFINS003", current_version, min_13_version, min_14_version) + super("CHEFINS003", D::SHORT, current_version, min_13_version, min_14_version) end end class Client14Outdated < ChefApply::ErrorNoLogs def initialize(current_version, target_version) - super("CHEFINS004", current_version, target_version) + super("CHEFINS004", D::SHORT, current_version, target_version) end end end diff --git a/lib/chef_apply/cli.rb b/lib/chef_apply/cli.rb index 423d4f3708..82f2f59ac9 100644 --- a/lib/chef_apply/cli.rb +++ b/lib/chef_apply/cli.rb @@ -39,6 +39,8 @@ require_relative "action/generate_local_policy" require_relative "action/converge_target" +require_relative "dist" + module ChefApply class CLI attr_reader :temp_cookbook, :archive_file_location, :target_hosts @@ -56,6 +58,7 @@ class CLI RC_COMMAND_FAILED = 1 RC_UNHANDLED_ERROR = 32 RC_ERROR_HANDLING_FAILED = 64 + D = ChefApply::Dist def initialize(argv) @argv = argv.clone @@ -181,28 +184,28 @@ def connect_target(target_host, reporter) def install(target_host, reporter) require_relative "action/install_chef" context = TS.install_chef - reporter.update(context.verifying) + reporter.update(context.verifying(D::SHORT)) installer = Action::InstallChef.new(target_host: target_host, check_only: !parsed_options[:install]) installer.run do |event, data| case event when :installing if installer.upgrading? - message = context.upgrading(target_host.installed_chef_version, installer.version_to_install) + message = context.upgrading(D::SHORT, target_host.installed_chef_version, installer.version_to_install) else - message = context.installing(installer.version_to_install) + message = context.installing(D::SHORT, installer.version_to_install) end reporter.update(message) when :uploading - reporter.update(context.uploading) + reporter.update(context.uploading(D::SHORT)) when :downloading - reporter.update(context.downloading) + reporter.update(context.downloading(D::SHORT)) when :already_installed - reporter.update(context.already_present(target_host.installed_chef_version)) + reporter.update(context.already_present(D::SHORT, target_host.installed_chef_version)) when :install_complete if installer.upgrading? - message = context.upgrade_success(target_host.installed_chef_version, installer.version_to_install) + message = context.upgrade_success(D::SHORT, target_host.installed_chef_version, installer.version_to_install) else - message = context.install_success(installer.version_to_install) + message = context.install_success(D::SHORT, installer.version_to_install) end reporter.update(message) else @@ -340,6 +343,6 @@ def do_connect(target_host, reporter) end class LicenseCheckFailed < ChefApply::Error - def initialize(); super("CHEFLIC001"); end + def initialize(); super("CHEFLIC001", ChefApply::Dist::CLIENT, ChefApply::Dist::SHORT); end end end diff --git a/lib/chef_apply/cli/help.rb b/lib/chef_apply/cli/help.rb index ec47b2ec6d..a58f5ecbb6 100644 --- a/lib/chef_apply/cli/help.rb +++ b/lib/chef_apply/cli/help.rb @@ -57,12 +57,12 @@ def format_flags end def usage - T.usage + T.usage(ChefApply::Dist::RUNEXEC) end def show_version require_relative "../version" - UI::Terminal.output T.version.show(ChefApply::VERSION) + UI::Terminal.output T.version.show(ChefApply::Dist::RUNEXEC, ChefApply::VERSION) end end end diff --git a/lib/chef_apply/cli/options.rb b/lib/chef_apply/cli/options.rb index 1478037296..5c8f470866 100644 --- a/lib/chef_apply/cli/options.rb +++ b/lib/chef_apply/cli/options.rb @@ -34,18 +34,18 @@ module Options TS = ChefApply::Text.status def self.included(klass) - klass.banner T.description + "\n" + T.usage_full + klass.banner T.description(ChefApply::Dist::RUN, ChefApply::Dist::SHORT) + "\n" + T.usage_full(ChefApply::Dist::RUNEXEC, ChefApply::Dist::SHORT, ChefApply::Dist::EXEC) klass.option :version, short: "-v", long: "--version", - description: T.version.description, + description: T.version.description(ChefApply::Dist::RUN), boolean: true klass.option :help, short: "-h", long: "--help", - description: T.help.description, + description: T.help.description(ChefApply::Dist::RUNEXEC), boolean: true # Special note: @@ -115,7 +115,7 @@ def self.included(klass) long: "--[no-]install", default: true, boolean: true, - description: T.install_description + description: T.install_description(ChefApply::Dist::CLIENT) klass.option :sudo, long: "--[no-]sudo", diff --git a/lib/chef_apply/dist.rb b/lib/chef_apply/dist.rb new file mode 100644 index 0000000000..31d06bdb06 --- /dev/null +++ b/lib/chef_apply/dist.rb @@ -0,0 +1,80 @@ +module ChefApply + module Dist + # This class is not fully implemented, depending on it is not recommended! + # When referencing a product directly, like Chef (Now Chef Infra) + PRODUCT = "Chef Infra Client".freeze + + # The name of the server product + SERVER_PRODUCT = "Chef Infra Server".freeze + + # Short name for Chef Infra + SHORT = "Chef".freeze + + # The client's alias (chef-client) + CLIENT = "chef-client".freeze + + # name of the automate product + AUTOMATE = "Chef Automate".freeze + + # The chef executable, as in `chef gem install` or `chef generate cookbook` + EXEC = "chef".freeze + + # The workstation's product name + WORKSTATION = "Chef Workstation".freeze + + # product website address + WEBSITE = "https://chef.io".freeze + + # chef-apply's product name + APPLY = "chef-run".freeze + + # chef-apply's executable + APPLYEXEC = "chef-apply".freeze + + # chef-run's product name + RUN = "Chef Run".freeze + + # chef-run executable + RUNEXEC = "chef-run".freeze + + # Chef-Zero's product name + ZERO = "Chef Infra Zero".freeze + + # Chef-Solo's product name + SOLO = "Chef Infra Solo".freeze + + # The chef-zero executable (local mode) + ZEROEXEC = "chef-zero".freeze + + # The chef-solo executable (legacy local mode) + SOLOEXEC = "chef-solo".freeze + + # The chef-shell executable + SHELL = "chef-shell".freeze + + # Configuration related constants + # The chef-shell configuration file + SHELL_CONF = "chef_shell.rb".freeze + + # The configuration directory + CONF_DIR = "/etc/#{ChefApply::Dist::EXEC}".freeze + + # The user's configuration directory + USER_CONF_DIR = ".chef".freeze + + # Workstation user configs + WORKSTATION_USER_CONF_DIR = ".chef-workstation".freeze + + # The old ChefDk's product name + DK = "ChefDK".freeze + + # The server's configuration directory + SERVER_CONF_DIR = "/etc/chef-server".freeze + + # download.chef.io + DOWNLOADS_URL = "downloads.chef.io".freeze + + # the "chef-workstation" in downloads.chef.io/chef-workstation/stable + WORKSTATION_URL_SUFFIX = "chef-workstation".freeze + end +end diff --git a/lib/chef_apply/startup.rb b/lib/chef_apply/startup.rb index 41bc9e4cb7..314e87363d 100644 --- a/lib/chef_apply/startup.rb +++ b/lib/chef_apply/startup.rb @@ -20,6 +20,9 @@ require_relative "telemeter" require "chef/log" require "chef/config" + +require_relative "dist" + module ChefApply class Startup attr_reader :argv @@ -71,9 +74,9 @@ def run rescue ConfigPathInvalid => e UI::Terminal.output(T.error.bad_config_file(e.path)) rescue ConfigPathNotProvided - UI::Terminal.output(T.error.missing_config_path) + UI::Terminal.output(T.error.missing_config_path(ChefApply::Dist::RUNEXEC, ChefApply::Dist::DK)) rescue UnsupportedInstallation - UI::Terminal.output(T.error.unsupported_installation) + UI::Terminal.output(T.error.unsupported_installation(ChefApply::Dist::RUNEXEC, ChefApply::Dist::DK, ChefApply::Dist::WORKSTATION, ChefApply::Dist::DOWNLOADS_URL)) rescue Mixlib::Config::UnknownConfigOptionError => e # Ideally we'd update the exception in mixlib to include # a field with the faulty value, line number, and nested context - @@ -125,7 +128,7 @@ def setup_telemetry # Tell the user we're anonymously tracking, give brief opt-out # and a link to detailed information. - UI::Terminal.output T.telemetry_enabled(Config.location) + UI::Terminal.output T.telemetry_enabled(ChefApply::Dist::RUNEXEC, Config.location) UI::Terminal.output "" end diff --git a/spec/integration/fixtures/chef_help.out b/spec/integration/fixtures/chef_help.out index d1aaaa017d..3e7282f427 100644 --- a/spec/integration/fixtures/chef_help.out +++ b/spec/integration/fixtures/chef_help.out @@ -45,9 +45,9 @@ FLAGS: --cookbook-repo-paths PATH Comma separated list of cookbook repository paths. -h, --help Show help and usage for `chef-run` -i, --identity-file PATH SSH identity file to use when connecting. Keys loaded into ssh-agent will also be used. - --[no-]install Install Chef client on the target host(s) if it is not installed. + --[no-]install Install chef-client on the target host(s) if it is not installed. This defaults to enabled - the installation will be performed - if there is no Chef client on the target(s). + if there is no chef-client installation on the target(s). --password Password to use for authentication to the target(s). The same password will be used for all targets. -p, --protocol The protocol to use for connecting to targets. diff --git a/spec/unit/action/converge_target_spec.rb b/spec/unit/action/converge_target_spec.rb index bb8e66ec39..d1063ea7d2 100644 --- a/spec/unit/action/converge_target_spec.rb +++ b/spec/unit/action/converge_target_spec.rb @@ -190,7 +190,7 @@ ) expect(target_host).to receive(:upload_file).with(local_tempfile.path, remote_config_path) expect(subject.create_remote_config(remote_folder)).to eq(remote_config_path) - # ensure the tempfile is deleted locally + # ensure the tempfile is deleted locally expect(local_tempfile.closed?).to eq(true) end end diff --git a/spec/unit/cli_spec.rb b/spec/unit/cli_spec.rb index 5c00e8b56e..12f11bef28 100644 --- a/spec/unit/cli_spec.rb +++ b/spec/unit/cli_spec.rb @@ -397,7 +397,7 @@ it "updates status, creates an InstallChef action and executes it" do expect(reporter) .to receive(:update) - .with(ChefApply::CLI::TS.install_chef.verifying) + .with(ChefApply::CLI::TS.install_chef.verifying("Chef")) expect(ChefApply::Action::InstallChef).to receive(:new) .with(target_host: target_host, check_only: false) .and_return action @@ -415,7 +415,7 @@ allow(action) .to receive(:run) { |&block| block.call(event, event_args) } allow(reporter) - .to receive(:update).with(ChefApply::CLI::TS.install_chef.verifying) + .to receive(:update).with(ChefApply::CLI::TS.install_chef.verifying("Chef")) end context ":installing" do @@ -424,7 +424,7 @@ context "when installer is upgrading" do let(:upgrading) { true } it "reports the update correctly" do - expect(reporter).to receive(:update).with(text_context.upgrading(target_host.installed_chef_version, action.version_to_install)) + expect(reporter).to receive(:update).with(text_context.upgrading("Chef", target_host.installed_chef_version, action.version_to_install)) subject.install(target_host, reporter) end end @@ -432,7 +432,7 @@ context "when installer is installing clean" do let(:upgrading) { false } it "reports the update correctly" do - expect(reporter).to receive(:update).with(text_context.installing(action.version_to_install)) + expect(reporter).to receive(:update).with(text_context.installing("Chef", action.version_to_install)) subject.install(target_host, reporter) end end @@ -441,7 +441,7 @@ context ":uploading" do let(:event) { :uploading } it "reports the update correctly" do - expect(reporter).to receive(:update).with(text_context.uploading) + expect(reporter).to receive(:update).with(text_context.uploading("Chef")) subject.install(target_host, reporter) end end @@ -449,7 +449,7 @@ context ":downloading" do let(:event) { :downloading } it "reports the update correctly" do - expect(reporter).to receive(:update).with(text_context.downloading) + expect(reporter).to receive(:update).with(text_context.downloading("Chef")) subject.install(target_host, reporter) end end @@ -457,7 +457,7 @@ context ":already_installed" do let(:event) { :already_installed } it "reports the update correctly" do - expect(reporter).to receive(:update).with(text_context.already_present(target_host.installed_chef_version)) + expect(reporter).to receive(:update).with(text_context.already_present("Chef", target_host.installed_chef_version)) subject.install(target_host, reporter) end end @@ -467,7 +467,7 @@ context "when installer is upgrading" do let(:upgrading) { true } it "reports the update correctly" do - expect(reporter).to receive(:update).with(text_context.upgrade_success(target_host.installed_chef_version, + expect(reporter).to receive(:update).with(text_context.upgrade_success("Chef", target_host.installed_chef_version, action.version_to_install)) subject.install(target_host, reporter) end @@ -476,7 +476,7 @@ context "when installer installing clean" do let(:upgrading) { false } it "reports the update correctly" do - expect(reporter).to receive(:update).with(text_context.install_success(target_host.installed_chef_version)) + expect(reporter).to receive(:update).with(text_context.install_success("Chef", target_host.installed_chef_version)) subject.install(target_host, reporter) end end diff --git a/spec/unit/startup_spec.rb b/spec/unit/startup_spec.rb index d0899ced19..878f69ade6 100644 --- a/spec/unit/startup_spec.rb +++ b/spec/unit/startup_spec.rb @@ -86,7 +86,7 @@ let(:error) { ChefApply::Startup::ConfigPathNotProvided.new } it "shows the correct error" do - expected_text = error_text.missing_config_path + expected_text = error_text.missing_config_path("chef-run", "ChefDK", "Chef Workstation") expect(ChefApply::UI::Terminal).to receive(:output).with(expected_text) subject.run end @@ -96,7 +96,7 @@ let(:error) { ChefApply::Startup::UnsupportedInstallation.new } it "shows the correct error" do - expected_text = error_text.unsupported_installation + expected_text = error_text.unsupported_installation("chef-run", "ChefDK", "Chef Workstation", "downloads.chef.io", "chef-workstation") expect(ChefApply::UI::Terminal).to receive(:output).with(expected_text) subject.run end