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

3.1.1 Breaks specs on supported Chef versions without manual chefspec updates #207

Closed
mmcguinn opened this issue Jul 26, 2018 · 5 comments
Closed
Labels
Stale This is marked as stale and will be closed shortly

Comments

@mmcguinn
Copy link

mmcguinn commented Jul 26, 2018

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.

@welcomebot
Copy link

Hey There
It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you.
Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.

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.

@mmcguinn mmcguinn changed the title 3.1.1 Breaks on supported Chef versions without manual chefspec updates 3.1.1 Breaks specs on supported Chef versions without manual chefspec updates Jul 26, 2018
@oscar123mendoza
Copy link

Im running into the same thing. Pinning to 3.1.0 for now.

@bliuchak
Copy link

bliuchak commented Nov 29, 2018

There are two simple solutions:

  1. Upgrade chefspec to version 7.1
  2. Or define custom matcher in your spec_helper.rb
if defined?(ChefSpec)
  ChefSpec.define_matcher :ark
   def install_ark(resource_name)
    ChefSpec::Matchers::ResourceMatcher.new(:ark, :install, resource_name)
  end
end

@github-actions
Copy link

github-actions bot commented Jan 8, 2021

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.

@github-actions github-actions bot added the Stale This is marked as stale and will be closed shortly label Jan 8, 2021
@github-actions
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale This is marked as stale and will be closed shortly
Projects
None yet
Development

No branches or pull requests

4 participants