Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for box_download_ca_cert #274

Merged
merged 9 commits into from
Jan 8, 2017
Merged

Add support for box_download_ca_cert #274

merged 9 commits into from
Jan 8, 2017

Conversation

cheeseplus
Copy link
Contributor

Closes #234

it "sets :box_download_ca_cert to a custom value" do
config[:box_download_ca_cert] = "cacert.pem"

expect(driver[:box_download_ca_cert]).to eq("cacert.pem")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused about this test, I would have expected '/kroot/cacert.pem'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably because the path does not get resolved with kitchen_root until the render_template method.

it "sets :box_download_ca_cert to a custom value" do
config[:box_download_ca_cert] = "cacert.pem"

expect(driver[:box_download_ca_cert]).to eq("cacert.pem")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably because the path does not get resolved with kitchen_root until the render_template method.

@@ -326,6 +328,9 @@ def load_needed_dependencies!
# @raise [ActionFailed] if the Vagrantfile template was not found
# @api private
def render_template
config[:box_download_ca_cert] = File.expand_path(
config[:box_download_ca_cert], config[:kitchen_root]) unless
config[:box_download_ca_cert].nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this to finalize_config which I believe will mean you can more easily test this (see comment below)

@cheeseplus
Copy link
Contributor Author

Moved the code around as suggested and the tests now seem like they are working right, lemme know if it needs any more work!

Copy link

@drrk drrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@cheeseplus cheeseplus merged commit 77de176 into master Jan 8, 2017
@tas50 tas50 deleted the pr234 branch January 30, 2022 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants