Skip to content

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 kathackeray force-pushed the mojolicious-command-subtests branch from 14107da to 724df65 Compare February 25, 2022 13:42
@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