houseabsolute / test-class-moose

Serious testing for serious Perl
http://metacpan.org/release/Test-Class-Moose/
Other
18 stars 32 forks source link

Bail out if a class extends Test::Class::Moose with a nonexisting/bogus class #93

Closed HaraldJoerg closed 6 years ago

HaraldJoerg commented 6 years ago

A module can extend another test module like this: use Test::Class::Moose extends => 'My::Other::Test::Module'; With this patch, loading fails if My::Other::Test::Module either does not exist at all, or exists but is not a test module (i.e. does not use Test::Class::Moose itself) - instead of silently discarding the test class. Some tests and a doc update are included. Closes #70.

autarch commented 6 years ago

Also, this needs an entry in the Changes file.

HaraldJoerg commented 6 years ago

So, I hope I have implemented all your suggestions. I have factored out the grammar stuff to formulate the error message in an extra sub because I felt it would distract too much from the usual test workflow. I apologize for the messy git history: I guess I made some mistake and am now unable to clean up.

autarch commented 6 years ago

Something very weird is happening in this PR. The first three commits appear twice in a row for some weird reason. It might be easiest to make a new branch and cherry pick the commits.

HaraldJoerg commented 6 years ago

I agree - the mess in this branch is too ugly. New PR coming up in a moment, against your current master branch.

autarch commented 6 years ago

No need to close this PR. Just make a new branch of the same name and force push.

HaraldJoerg commented 6 years ago

Yes, thanks for the hint. I figured out that I could try a force push, and apparently it worked as intended. I had never done this for a PR-related branch before.

So, there's the problem with the Travis checks. I didn't see that issue in my tests with Test2::IPC version 1.302120, but get it after upgrading Test2::IPC to the CPAN version 1.302138 used by Travis.

A short research revealed that it is a known issue in exodist's module, and if I run the test with his git HEAD (July 17) then the warning disappears. So I guess this has to wait until Chad pushes to CPAN.

autarch commented 6 years ago

I merged this from the CLI with some tweaks. I'll wait for Travis to start passing again before a release.