summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorLance Albertson <lance@osuosl.org>2020-06-06 21:45:01 -0700
committerLance Albertson <lance@osuosl.org>2020-06-08 12:34:39 -0700
commitb8166de42ec1a7841eff9a7e2d7e6b6724075d89 (patch)
tree255e6feb7e18b12fd550d8ee5528ec25442095e2 /spec/unit
parent090e973e565a49fa48cf58a0fb95e5bc56002ef3 (diff)
downloadchef-b8166de42ec1a7841eff9a7e2d7e6b6724075d89.tar.gz
Fix how enforce_license is set in run method for chef-apply
I recently discovered that when using Chef::Application::Apply.new.run(enforce_license: false), chef-apply will still run the license verification when I expected it to be disabled. It seems this feature works if you install this as a gem, however if you build chef using omnibus with this set, it refuses to work. I suspect this might be something with appbundler. I noticed that other binaries (i.e. solo) were using "run(enforce_license: false)" instead of "run(enforce_license = false)" which chef-apply uses. If I changed this to "run(enforce_license: false)", this worked as expected. Signed-off-by: Lance Albertson <lance@osuosl.org>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/application_spec.rb7
1 files changed, 7 insertions, 0 deletions
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