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

Generate tests via hook_for :test_framework #132

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

darronschall
Copy link

Leverage the hook_for API to separate the test framework generation. This follows the rails pattern, and paves the way for adding other test framework templates more easily (e.g. rspec that was started in #88).

Along the way, move the users.yml fixture into a fixtures subfolder and convert the copy_file to a template for consistency.

Note that that TestUnit generator repeats some class_options, but only the ones that actually impact test generation. The only option test generation currently supports is --api.

Leverage the [`hook_for`](https://api.rubyonrails.org/classes/Rails/Generators/Base.html#method-c-hook_for) API to separate the test framework generation. This follows the rails pattern, and paves the way for adding other test framework templates (e.g. rspec).

Along the way, move the `users.yml` fixture into a `fixtures` subfolder and convert the `copy_file` to a `template` for consistency.
Since we're using `template` for this file now, convert it to an actual template.
@darronschall darronschall force-pushed the use-hook-for-test-framework branch from 93e1121 to 3a64253 Compare December 12, 2024 18: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