Skip to content

Conversation

@dafyddcrosby
Copy link
Contributor

Summary:
Add a new bookworm key cookbookrspec to detect RSpec test files in
cookbooks, and create a corresponding CookbookRspecExists rule. Since normal
rspec and chefspec can be side-by-side, I opted for the more generic key. We're
ignoring helper-type files, only focusing on _spec since that's where the tests
need to reside.

The key uses:

  • glob_pattern: /spec/_spec.rb
  • path_name_regex: spec/(.*)_spec.rb
  • determine_cookbook_name: true

This enables bookworm to track which cookbooks have RSpec test files.

Differential Revision: D90535240

@meta-codesync
Copy link

meta-codesync bot commented Jan 13, 2026

@dafyddcrosby has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90535240.

Summary:
Pull Request resolved: facebook#12

Add a new bookworm key `cookbookrspec` to detect RSpec test files in
cookbooks, and create a corresponding `CookbookRspecExists` rule. Since normal
rspec and chefspec can be side-by-side, I opted for the more generic key. We're
ignoring helper-type files, only focusing on _spec since that's where the tests
need to reside.

The key uses:
- glob_pattern: */spec/*_spec.rb
- path_name_regex: spec/(.*)_spec\.rb
- determine_cookbook_name: true

This enables bookworm to track which cookbooks have RSpec test files.

Differential Revision: D90535240
meta-codesync bot pushed a commit to facebook/chef-cookbooks that referenced this pull request Jan 14, 2026
Summary:
X-link: facebook/bookworm#12

Add a new bookworm key `cookbookrspec` to detect RSpec test files in
cookbooks, and create a corresponding `CookbookRspecExists` rule. Since normal
rspec and chefspec can be side-by-side, I opted for the more generic key. We're
ignoring helper-type files, only focusing on _spec since that's where the tests
need to reside.

The key uses:
- glob_pattern: */spec/*_spec.rb
- path_name_regex: spec/(.*)_spec\.rb
- determine_cookbook_name: true

This enables bookworm to track which cookbooks have RSpec test files.

Reviewed By: joshuamiller01

Differential Revision: D90535240

fbshipit-source-id: 1d2f958ac61b5afd089bebc62f1435fef4390412
@meta-codesync meta-codesync bot closed this in df51490 Jan 14, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 14, 2026

This pull request has been merged in df51490.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants