-
Notifications
You must be signed in to change notification settings - Fork 339
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
create_remote_file fails with action :create_if_missing #118
Comments
This applies to the file resource as well. |
/cc @jtimberman |
And it applies to templates too. |
I ran into this when I upgraded from chefspec 0.9.0 to 1.3.1. The problem is indeed that, now, the create_remote_file matcher only matches on action :create. I'll take a crack at adding support for an action parm to this matcher and submit a pull request. |
I realized this should probably be addressed with new matchers: |
Still can't get this to work for file resource. |
Released in 2.0.0 |
I want a tarball to download only if it does not already exist. That's why I use :create_if_missing in my recipe.
IMO the test "create_remote_file" should succeed for remote_file resources declared with action:create_if_missing as well as action:create.
EDIT: This seems to apply to create_cookbook_file as well.
The following output shows what I get when I run chefspec with this resource defined:
remote_file "/tmp/gi.tar.gz" do
source "#{node[:application_tier][:package_url]}"
owner "root"
group "root"
mode "0755"
action :create_if_missing
end
Chefspec Output:
2) application_tier::install should download tarball
Failure/Error: chef_run.should create_remote_file '/tmp/bi.tar.gz'
ArgumentError:
Failure message is nil. Does your matcher define the appropriate failure_message_for_* method to return a string?
# ./chef__repo/cookbooks/application_tier/spec/install_spec.rb:8:in `block (2 levels) in <top (required)>'
I've converted this to a list:
The text was updated successfully, but these errors were encountered: