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

Convert t/mojolicious/command.t to use subtests #1917

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

kathackeray
Copy link
Contributor

@kathackeray kathackeray commented Feb 17, 2022

Summary

The file t/mojolicious/command.t has been organised into subtests, and spacing added to create blocks within.

Note that the following variables were originally global, but have now been scoped to each subtest requiring them:

  • $buffer
  • $template
  • $command
  • $cwd
  • $dir

Motivation

Towards resolution of #1520

References

Refer to discussion in #1520

remove all global variables into subtest scope
@kathackeray
Copy link
Contributor Author

my $command = Mojolicious::Command->new;
my $cwd = path;
my $dir = tempdir;

I had intentionally left the above shared variables in the global scope to be used between tests, as they were never modified. Following advice in #1914, I have removed these and duplicated them into the subtest scopes.

Ready for review.

@kiwiroy
Copy link
Contributor

kiwiroy commented Apr 7, 2022

LGTM

Copy link
Member

@jhthorsen jhthorsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Member

@marcusramberg marcusramberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mergify mergify bot merged commit d6fcf74 into mojolicious:main Jul 25, 2022
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.

4 participants