Skip to content

Support fixture file globs and prepare version 0.6.0 - #57

Merged
dblock merged 1 commit into
masterfrom
dblock/rspec-copy-globs
Nov 11, 2026
Merged

dblock merged 1 commit into
masterfrom
dblock/rspec-copy-globs

Conversation

@dblock

@dblock dblock commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Summary

Add relative glob selectors to the optional RSpec fixture helper:

project.copy_files(path: source_root)
project.copy_files(path: source_root, files: %w[README.md bin/run])
project.copy_files(path: source_root, files: [])
project.copy_files(path: source_root, files: '**/*.{js,md}')
project.copy_files(path: source_root, files: ['README.md', 'lib/**/*.rb'])

files: accepts a single path or pattern, or a mixed array. Recursive patterns, brace alternatives, character classes, and hidden files are supported. Existing exact paths take precedence over glob syntax; overlapping selectors copy each relative file once. Omitted or nil files: still copies everything, and an empty array still copies nothing.

Reuse the existing source traversal rather than following directory links during glob expansion. Skip Git metadata, reject unmatched selectors and escaping paths/links, and validate every selected source and destination before copying. Preserve file bytes, relative paths, modes, and existing literal-file behavior.

Document every invocation form and the matching, hidden-file, Git, symbolic-link, overwrite, and failure rules in Testing Custom Workflows. Update the complete lifecycle example to combine glob copying with the workflow helper merged in #56.

Bump the gem version and Next changelog section to 0.6.0 in this same PR. Published workflow pins remain unchanged until release. This does not publish or tag a release.

Validation

  • bundle exec rake SPEC_OPTS='--seed 12345': 354 examples, no failures; 148 RuboCop files, no offenses.
  • bundle exec rake build: produces ruby-gem-release-0.6.0.gem.
  • Install that archive into a disposable local gem home and run the complete lifecycle example against the installed helper, verifying real project hooks and exact local publication archives.
  • Focused cases cover recursive/brace/class/question-mark patterns, hidden files, mixed selectors, deduplication, literal wildcard filenames, no matches, directory entries, Git metadata, and source/destination link escapes.

Created by an AI assistant on behalf of @dblock.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock merged commit 9507fdf into master Nov 11, 2026
7 checks passed
@dblock
dblock deleted the dblock/rspec-copy-globs branch November 11, 2026 19:21
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.

1 participant