-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
3.1.1 Breaks specs on supported Chef versions without manual chefspec updates #207
Comments
Hey There If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution. |
Im running into the same thing. Pinning to |
There are two simple solutions:
if defined?(ChefSpec)
ChefSpec.define_matcher :ark
def install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install, resource_name)
end
end |
Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs. |
Closing due to inactivity. If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs. |
Cookbook version
3.1.1
Chef-client version
12.19.36
Platform Details
N/A (but running Centos 7 where I am replicating)
Scenario:
The matchers.rb file was removed in a patch update (3.1.0 -> 3.1.1) even though its a breaking change for testing supported chef versions.
Steps to Reproduce:
Using the chef version above (for example with https://downloads.chef.io/chefdk/stable/1.6.11, or otherwise via gem) and attempt to write a spec for Ark,
expect(chef_run).to( install_ark('...
. With Ark 3.1.0 this will work, with Ark 3.1.1 you'll get:undefined method 'install_ark' ...
.Expected Result:
The spec should operate correctly with 3.1.1 as it did with 3.1.0 since it was a patch version and I'm using a supported chef version for ark 3.1.1.
Actual Result:
The error as noted above:
undefined method 'install_ark' ...
.I assume this problem exists for anyone using a chef version that doesn't include chefspec 7.1.0 and hasn't manually upgraded. It's reasonable to switch to this new feature (and require the chefspec upgrade), but I don't think it should have been done with a patch version.
The text was updated successfully, but these errors were encountered: