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

Use Spoom::Context instead of custom abstraction #1643

Merged
merged 5 commits into from
Sep 6, 2023
Merged

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Sep 5, 2023

We currently use 3 custom abstractions in our tests:

  • MockDir: to create directories and manipulate them, also used to create annotations repositories.
  • MockProject: A subclass of MockDir that abstracts a project that would use Tapioca. It provides basic commands to register mock gems and run the tapioca command in the context of the project.
  • MockGem: A subclass of MockDir that abstracts a gem that can be required to a MockProject and will be loaded by Tapioca to generate RBI for.

This migrate these abstraction to Spoom::Context that provides similar features and much more. This completely removes the need for MockDir and simplifies MockProject and MockGem.

One limitation of Spoom::Context vs. MockProject is the way we currently set the bundler version in the context of a test. Spoom::Context doesn't support that at the moment. I changed the override to be marked as allow_incompatible so we can add additional keyword arguments. I'll look into adding this feature to Spoom.

This PR is easier to review commit by commit.

@Morriar Morriar added the chore label Sep 5, 2023
@Morriar Morriar requested a review from a team as a code owner September 5, 2023 15:43
@Morriar Morriar self-assigned this Sep 5, 2023
@Morriar Morriar merged commit 2d6f766 into main Sep 6, 2023
30 checks passed
@Morriar Morriar deleted the at-spoom-context branch September 6, 2023 13:31
@KaanOzkan KaanOzkan mentioned this pull request Sep 11, 2023
@shopify-shipit shopify-shipit bot temporarily deployed to production September 13, 2023 22:55 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants