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

Move most of spec runner's state into Spec::CLI #14170

Merged
merged 1 commit into from Jan 12, 2024

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Jan 4, 2024

This PR combines most of Spec's global state into a new Spec::CLI class, with the end goal of making the spec runner itself more reusable and testable. The new singleton state is Spec.cli; eventually, only Spec's public class methods should delegate to this singleton, and methods within the runner shouldn't refer to it. The remaining class variables are:

  • Spec::RootContext.@@instance
  • Spec::RootContext.@@current_context
  • Spec::RootContext.@@spec_nesting
  • Spec::Example.@@example_counter
  • Spec.@@lines_cache

Class methods of Spec that should have been nodoc are marked as deprecated.

@straight-shoota straight-shoota added this to the 1.12.0 milestone Jan 9, 2024
@Fryguy
Copy link
Contributor

Fryguy commented Jan 9, 2024

Love this! I've had this on my TODO for so long but haven't had time. Thanks for digging into it!

@straight-shoota straight-shoota merged commit 6bfcfe8 into crystal-lang:master Jan 12, 2024
56 checks passed
@HertzDevil HertzDevil deleted the refactor/spec-cli branch January 26, 2024 22:50
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.

None yet

3 participants