>> Is there anything you would change?
>
>I don't *love* maintaining individual driver files (t/subsystem/feature.t),
>but I do like being able to run test classes individually with:
>
> $ prove -l t/subsystem/feature.t
>
>Is that easy to support?
Shouldn't be too hard. Maybe have a DEMOLISH which checks to see if the tests have been run and run them with a default (empty) constructor if they haven't.
Cheers,
Ovid
--
Twitter - http://twitter.com/OvidPerl/
Buy my book - http://bit.ly/beginning_perl
Buy my other book - http://www.oreilly.com/catalog/perlhks/
Live and work overseas - http://www.overseas-exile.com/
I can fix that later, but I wanted to get something out for you folks.
https://github.com/Ovid/test-class-moose
Note that I elected to not use attributes because they're hard for *you* to customize, but it's trivial for you to override the get_test_classes() and get_test_methods() behavior for your own testing purposes.
More work needs to be done, but I think you'll be pleased at how short the code is to do this.
Cheers,
Ovid
--
Twitter - http://twitter.com/OvidPerl/
Buy my book - http://bit.ly/beginning_perl
Buy my other book - http://www.oreilly.com/catalog/perlhks/
Live and work overseas - http://www.overseas-exile.com/
>________________________________
> From: Jonathan Swartz <swa...@pobox.com>
>To: Ovid <publiuste...@yahoo.com>
>Cc: Perl QA <per...@perl.org>
>Sent: Wednesday, 12 December 2012, 19:18
>Subject: Re: Anyone want Test::Class::Moose?
This is something I've wondered as well. Several times when people asked me about using Test::Class with Moose I pointed them to Test::Able, though I confess I never used that code. Invariably they would not choose it. I think what's going on is the interface. It looks "different" and that's possibly scaring people off. The interface for Test::Class::Moose looks very similar to Test::Class and that might make for easier adoption if I ever do enough to get it out of alpha.
Please note that I'm not saying that what I've written is better! However, the comfort level of the Test::Class::Moose interface may be appealing to some.
Cheers,
Ovid
--
Twitter - http://twitter.com/OvidPerl/
Buy my book - http://bit.ly/beginning_perl
Buy my other book - http://www.oreilly.com/catalog/perlhks/
Live and work overseas - http://www.overseas-exile.com/
>________________________________
> From: Justin DeVuyst <jus...@devuyst.com>
>To: per...@perl.org
>Sent: Friday, 14 December 2012, 19:54
>Subject: Re: Anyone want Test::Class::Moose?
>
>________________________________
> From: Mark Stosberg <ma...@summersault.com>
>As I looked more at Test::Class::Moose, one thing I really like is that
>plans are completely gone. Thank you.
You're welcome. They're inferred at the suite and class level, but with an implicit "done_testing()" for each method. It's not perfect, but there alternatives seemed a touch worse.
>Two questions:
>
>1. About this: "use Test::Class::Moose;"
>
>Why not standard inheritance to add Test::Class functionality?
>
>It looke the rationale here is to save a line of boilerplate with the
>"use Moose" line.
Test::Class::Moose is explicitly coupled with Moose, so having a "use Moose" line is both redundant and error-prone. If it's required and you forget it, oops. I've given you a source of bugs you didn't need. If it's not required, why write it?
>2. About this syntax for extending a test class:
> use Test::Class::Moose parent => 'TestsFor::Some::Class';
>
>why not use standard inheritance in a class, and to extend a class using
>test::Class? Or could you 'extends' in the import list here to look more
>Moose-y?
I think "extends" might be better. Good call.
I don't use standard inheritance because the various solutions for that don't allow for both inheriting from a class and exporting functions (in this case, ok(), is(), eq_or_diff(), and so on).