summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/application/apply.rb2
-rw-r--r--spec/unit/application_spec.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb
index 6469e9b532..c858e02eda 100644
--- a/lib/chef/application/apply.rb
+++ b/lib/chef/application/apply.rb
@@ -216,7 +216,7 @@ class Chef::Application::Apply < Chef::Application
end
# Get this party started
- def run(enforce_license = false)
+ def run(enforce_license: false)
reconfigure
check_license_acceptance if enforce_license
run_application
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index f5800e61a9..655c98bef6 100644
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -94,6 +94,13 @@ describe Chef::Application do
end
end
+ describe "when enforce_license is set to false" do
+ it "should not check the license acceptance" do
+ expect(@app).to_not receive(:check_license_acceptance)
+ @app.run(enforce_license: false)
+ end
+ end
+
it "should run the actual application" do
expect(@app).to receive(:run_application).and_return(true)
@app.run