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 33a8a97f5b..4ed2d2a1f2 100644
--- a/lib/chef/application/apply.rb
+++ b/lib/chef/application/apply.rb
@@ -233,7 +233,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 ea784f1d55..031132f31d 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