Skip to content

Commit ba006e4

Browse files
committed
Tidy all code with the latest perltidy (and podtidy)
1 parent a2a8573 commit ba006e4

File tree

6 files changed

+87
-86
lines changed

6 files changed

+87
-86
lines changed

lib/Test/Class/Moose.pm

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ __END__
281281
282282
=head1 DESCRIPTION
283283
284-
See the L<Test::Class::Moose home page|http://houseabsolute.github.io/test-class-moose/> for
285-
a summary.
284+
See the L<Test::Class::Moose home
285+
page|http://houseabsolute.github.io/test-class-moose/> for a summary.
286286
287287
C<Test::Class::Moose> is a powerful testing framework for Perl. Out of the box
288288
you get:
@@ -318,15 +318,15 @@ Just C<use Test::Class::Moose>. That's all. You'll get all L<Test::Most> test
318318
functions, too, along with C<strict> and C<warnings>. You can use all L<Moose>
319319
behavior, too.
320320
321-
When you C<use Test::Class::Moose> it inserts itself as a parent class for
322-
your test class. This means that if you try to use C<extends> in your test
323-
class you will break things unless you include C<Test::Class::Moose> as a
324-
parent. We recommend that you use roles in your test classes instead.
321+
When you C<use Test::Class::Moose> it inserts itself as a parent class for your
322+
test class. This means that if you try to use C<extends> in your test class you
323+
will break things unless you include C<Test::Class::Moose> as a parent. We
324+
recommend that you use roles in your test classes instead.
325325
326326
=head2 Declare a test method
327327
328-
All method names that begin with C<test_> are test methods. Methods that do
329-
not are not test methods.
328+
All method names that begin with C<test_> are test methods. Methods that do not
329+
are not test methods.
330330
331331
sub test_this_is_a_method {
332332
my $test = shift;
@@ -341,8 +341,8 @@ not are not test methods.
341341
}
342342
343343
You may specify C<Test> and C<Tests> method attributes, just like in
344-
L<Test::Class> and the method will automatically be a test method, even if
345-
does not start with C<test_>:
344+
L<Test::Class> and the method will automatically be a test method, even if does
345+
not start with C<test_>:
346346
347347
sub this_is_a_test : Test {
348348
pass 'we have a single test';
@@ -393,9 +393,9 @@ method modifier:
393393
# more tests
394394
};
395395
396-
Please note that if you call C<plan>, the plan will still show up at the end
397-
of the subtest run, but you'll get the desired failure if the number of tests
398-
run does not match the plan.
396+
Please note that if you call C<plan>, the plan will still show up at the end of
397+
the subtest run, but you'll get the desired failure if the number of tests run
398+
does not match the plan.
399399
400400
=head2 Inheriting from another Test::Class::Moose class
401401
@@ -511,13 +511,13 @@ The available test control methods are:
511511
}
512512
513513
Runs at the start of each test class. Quite often the base class that you
514-
inherit from will have its own C<test_startup> code running (such as starting
515-
a database transaction or connecting to an external resource). You almost
516-
always want to call C<< $test->next::method >> I<before> your own setup code.
517-
This ensures that the environment is set up to safely run your code. For
518-
example, if the parent C<test_startup> starts a database transaction with the
519-
expectation that the C<test_teardown> will end the database transactions, you
520-
can safely load database fixtures I<after> that is run.
514+
inherit from will have its own C<test_startup> code running (such as starting a
515+
database transaction or connecting to an external resource). You almost always
516+
want to call C<< $test->next::method >> I<before> your own setup code. This
517+
ensures that the environment is set up to safely run your code. For example, if
518+
the parent C<test_startup> starts a database transaction with the expectation
519+
that the C<test_teardown> will end the database transactions, you can safely
520+
load database fixtures I<after> that is run.
521521
522522
If you need to know the name of the class you're running this in (though
523523
usually you shouldn't), use C<< $test->test_class >>, or you can do this:
@@ -530,8 +530,8 @@ usually you shouldn't), use C<< $test->test_class >>, or you can do this:
530530
...
531531
}
532532
533-
The C<< $test->test_report >> object is a L<Test::Class::Moose::Report::Instance>
534-
object.
533+
The C<< $test->test_report >> object is a
534+
L<Test::Class::Moose::Report::Instance> object.
535535
536536
=head2 C<test_setup>
537537
@@ -598,10 +598,10 @@ can tell the L<Test::Class::Moose::Runner> to create multiple instances of a
598598
test class.
599599
600600
To do this, simply consume the
601-
L<Test::Class::Moose::Role::ParameterizedInstances> role in your test
602-
class. This role requires you to implement a C<_constructor_parameter_sets>
603-
method in your test class. That method will be called as a I<class method>. It
604-
is expected to return a list of key/value pairs. The keys are the name of the
601+
L<Test::Class::Moose::Role::ParameterizedInstances> role in your test class.
602+
This role requires you to implement a C<_constructor_parameter_sets> method in
603+
your test class. That method will be called as a I<class method>. It is
604+
expected to return a list of key/value pairs. The keys are the name of the
605605
instance and the values are hashrefs of attributes to be passed to your test
606606
class's constructor. Here's a really dumb example:
607607
@@ -630,15 +630,15 @@ instance>, and each instance will be run in its own subtest. You can
630630
dynamically decide to skip your test class completely by having
631631
C<_constructor_parameter_sets> return an empty list.
632632
633-
Note that this feature has great potential for abuse, so use it
634-
cautiously. That said, there are cases where this feature can greatly simplify
635-
your test code.
633+
Note that this feature has great potential for abuse, so use it cautiously.
634+
That said, there are cases where this feature can greatly simplify your test
635+
code.
636636
637637
=head1 RUNNING THE TEST SUITE
638638
639-
See the docs for L<Test::Class::Moose::Runner> for details on running your
640-
test suite. If you'd like to get up and running quickly, here's a very simple
641-
test file you can use:
639+
See the docs for L<Test::Class::Moose::Runner> for details on running your test
640+
suite. If you'd like to get up and running quickly, here's a very simple test
641+
file you can use:
642642
643643
use Test::Class::Moose::CLI;
644644
Test::Class::Moose::CLI->new_with_options->run;
@@ -658,9 +658,9 @@ If you wish to skip a class, set the reason in the C<test_startup> method.
658658
$test->test_skip("I don't want to run this class");
659659
}
660660
661-
If you are using L<test class instances|/"TEST CLASS INSTANCES">, you
662-
can also make C<_constructor_parameter_sets> return an empty list,
663-
which will result in the class being skipped.
661+
If you are using L<test class instances|/"TEST CLASS INSTANCES">, you can also
662+
make C<_constructor_parameter_sets> return an empty list, which will result in
663+
the class being skipped.
664664
665665
Note that if you run C<test_skip>, the C<test_shutdown> method will also be
666666
skipped. This is due to the assumption that you might not have run any setup
@@ -683,11 +683,11 @@ If you wish to skip an individual method, do so in the C<test_setup> method.
683683
684684
=head2 The "Tests" and "Test" Attributes
685685
686-
If you're comfortable with L<Test::Class>, you know that test methods methods are
687-
declared in L<Test::Class> with C<Test> (for a method with a single test) or
688-
C<Tests>, for a method with multiple tests. This also works for
689-
C<Test::Class::Moose>. Test methods declared this way do not need to start
690-
with C<test_>.
686+
If you're comfortable with L<Test::Class>, you know that test methods methods
687+
are declared in L<Test::Class> with C<Test> (for a method with a single test)
688+
or C<Tests>, for a method with multiple tests. This also works for
689+
C<Test::Class::Moose>. Test methods declared this way do not need to start with
690+
C<test_>.
691691
692692
sub something_we_want_to_check : Test {
693693
# this method may have only one test
@@ -725,22 +725,22 @@ And later:
725725
}
726726
727727
In the above example, C<TestsFor::Parent::some_test> will run three tests, but
728-
C<TestsFor::Child::some_test> will run I<five> tests (two tests, plus the
729-
three from the parent).
728+
C<TestsFor::Child::some_test> will run I<five> tests (two tests, plus the three
729+
from the parent).
730730
731-
Note that if a plan is explicitly declared, any modifiers or overriding
732-
methods calling the original method will also have to assert the number of
733-
tests to ensure the plan is correct. The above C<TestsFor::Parent> and
734-
C<TestsFor::Child> code would fail if the child's C<some_test> method
735-
attribute was C<Tests> without the number of tests asserted.
731+
Note that if a plan is explicitly declared, any modifiers or overriding methods
732+
calling the original method will also have to assert the number of tests to
733+
ensure the plan is correct. The above C<TestsFor::Parent> and
734+
C<TestsFor::Child> code would fail if the child's C<some_test> method attribute
735+
was C<Tests> without the number of tests asserted.
736736
737737
Do not use C<Test> or C<Tests> with test control methods because you don't run
738738
tests in those.
739739
740740
=head2 Tagging Methods
741741
742-
Sometimes you want to be able to assign metadata to help you better manage
743-
your test suite. You can do this with tags:
742+
Sometimes you want to be able to assign metadata to help you better manage your
743+
test suite. You can do this with tags:
744744
745745
sub test_save_poll_data : Tags(api network) {
746746
...
@@ -782,19 +782,20 @@ optional. Now it's mandatory, so those features should always work.
782782
... but probably shouldn't.
783783
784784
As a general rule, methods beginning with C</^test_/> are reserved for
785-
L<Test::Class::Moose>. This makes it easier to remember what you can and
786-
cannot override. However, any test with C<Test> or C<Tests> are test methods
785+
L<Test::Class::Moose>. This makes it easier to remember what you can and cannot
786+
override. However, any test with C<Test> or C<Tests> are test methods
787787
regardless of their names.
788788
789789
=head2 C<test_report>
790790
791791
my $report = $test->test_report;
792792
793-
Returns the L<Test::Class::Moose::Report> object. Useful if you want to do
794-
your own reporting and not rely on the default output provided with the
793+
Returns the L<Test::Class::Moose::Report> object. Useful if you want to do your
794+
own reporting and not rely on the default output provided with the
795795
C<statistics> boolean option.
796796
797-
You can also call it in test classes (most useful in the C<test_setup()> method):
797+
You can also call it in test classes (most useful in the C<test_setup()>
798+
method):
798799
799800
sub test_setup {
800801
my $test = shift;
@@ -960,9 +961,9 @@ for you, see L<Test::Class::Moose::Role::AutoUse> in this distribution.
960961
961962
=item *
962963
963-
The L<Test::Class::Moose::Config> class's C<args> method is now
964-
deprecated. This was a holdover from when Test::Class::Moose was both a parent
965-
class for your test classes and the test class runner.
964+
The L<Test::Class::Moose::Config> class's C<args> method is now deprecated.
965+
This was a holdover from when Test::Class::Moose was both a parent class for
966+
your test classes and the test class runner.
966967
967968
=back
968969
@@ -1001,10 +1002,9 @@ method was never intended to be run unconditionally.
10011002
=item *
10021003
10031004
Parallel testing now parallelizes test classes rather than individual test
1004-
instances. This is only relevant if your test suite contains parameterized
1005-
test classes. This is slightly less efficient, but made the internal test
1006-
running code much simpler and made it possible to fix reporting for parallel
1007-
test runs.
1005+
instances. This is only relevant if your test suite contains parameterized test
1006+
classes. This is slightly less efficient, but made the internal test running
1007+
code much simpler and made it possible to fix reporting for parallel test runs.
10081008
10091009
=item *
10101010
@@ -1022,13 +1022,13 @@ The L<Test::Class::Moose::Runner> C<builder> method has been removed.
10221022
10231023
=item * The L<Test::Class::Moose::Report> class's C<all_test_classes> method is un-deprecated
10241024
1025-
This method now returns a list of L<Test::Class::Moose::Report::Class>
1026-
objects. A class report contains one or more instance reports.
1025+
This method now returns a list of L<Test::Class::Moose::Report::Class> objects.
1026+
A class report contains one or more instance reports.
10271027
10281028
=item *
10291029
1030-
Removed the L<Test::Class::Moose::Report::Instance>'s error
1031-
attribute. Contrary to the documentation, this attribute was never populated.
1030+
Removed the L<Test::Class::Moose::Report::Instance>'s error attribute. Contrary
1031+
to the documentation, this attribute was never populated.
10321032
10331033
=item *
10341034
@@ -1043,8 +1043,8 @@ L<Test::Class::Moose::Report> and L<Test::Class::Moose::Report::Method>.
10431043
10441044
=item *
10451045
1046-
Removed the long-deprecated C<<
1047-
Test::Class::Moose::Report::Method->add_to_plan method >>.
1046+
Removed the long-deprecated C<< Test::Class::Moose::Report::Method->add_to_plan
1047+
method >>.
10481048
10491049
=back
10501050
@@ -1054,16 +1054,16 @@ Test::Class::Moose::Report::Method->add_to_plan method >>.
10541054
10551055
=item * Running tests with Test::Class::Moose is deprecated - use L<Test::Class::Moose::Runner>
10561056
1057-
As of version 0.55, running tests and being a test class have been
1058-
separated. Your test classes should continue to C<use Test::Class::Moose>, but
1059-
your test runner script should use L<Test::Class::Moose::Runner>:
1057+
As of version 0.55, running tests and being a test class have been separated.
1058+
Your test classes should continue to C<use Test::Class::Moose>, but your test
1059+
runner script should use L<Test::Class::Moose::Runner>:
10601060
10611061
use Test::Class::Moose::Load 't/lib';
10621062
use Test::Class::Moose::Runner;
10631063
Test::Class::Moose::Runner->new->runtests;
10641064
1065-
Calling C<< Test::Class::Moose->new->runtests >> still works, but is
1066-
deprecated and will issue a warning.
1065+
Calling C<< Test::Class::Moose->new->runtests >> still works, but is deprecated
1066+
and will issue a warning.
10671067
10681068
=item * Parallel testing is totally different
10691069
@@ -1074,8 +1074,8 @@ running tests in parallel.
10741074
=item * The L<Test::Class::Moose::Report> C<all_test_classes> method is deprecated
10751075
10761076
This has been replaced with the C<all_test_instances> method. The
1077-
C<all_test_classes> method is still present for backwards compatibility, but
1078-
it simply calls C<all_test_instances> under the hood.
1077+
C<all_test_classes> method is still present for backwards compatibility, but it
1078+
simply calls C<all_test_instances> under the hood.
10791079
10801080
=item * The C<Test::Class::Moose::Report::Class> class is gone
10811081
@@ -1116,9 +1116,9 @@ forgot it:
11161116
...
11171117
}
11181118
1119-
That second argument is still passed, but it's deprecated. It's now
1120-
recommended that you call the C<< $test->test_report >> method to get that.
1121-
Instead of this:
1119+
That second argument is still passed, but it's deprecated. It's now recommended
1120+
that you call the C<< $test->test_report >> method to get that. Instead of
1121+
this:
11221122
11231123
sub test_froblinator {
11241124
my ( $test, $report ) = @_;
@@ -1173,9 +1173,9 @@ L<https://metacpan.org/release/Test-Class-Moose/>
11731173
=item * L<Test::Routine>
11741174
11751175
I always pointed people to this when they would ask about L<Test::Class> +
1176-
L<Moose>, but I would always hear "that's not quite what I'm looking for".
1177-
I don't quite understand what the reasoning was, but I strongly encourage you
1178-
to take a look at L<Test::Routine>.
1176+
L<Moose>, but I would always hear "that's not quite what I'm looking for". I
1177+
don't quite understand what the reasoning was, but I strongly encourage you to
1178+
take a look at L<Test::Routine>.
11791179
11801180
=item * L<Test::Roo>
11811181

t/cli.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ subtest 'timing data file' => sub {
129129
is( $data,
130130
hash {
131131
field process_name => $0;
132-
field start_time =>
132+
field start_time =>
133133
validator( sub { defined $_ && $_ >= $time } );
134134
field timing => { timing => 'data' };
135135
},

t/parameterizedlib/TestsFor/Empty.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sub expected_test_events {
3737
};
3838
event Plan => sub {
3939
call directive => 'SKIP';
40-
call reason =>
40+
call reason =>
4141
q{Skipping 'TestsFor::Empty': no test instances found};
4242
call max => 0;
4343
};

t/skiplib/TestsFor/SkipSomeMethods.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ sub expected_test_events {
7373
call subevents => array {
7474
event Plan => sub {
7575
call directive => 'SKIP';
76-
call reason =>
76+
call reason =>
7777
'only methods listed as skipped should be skipped';
7878
call max => 0;
7979
};

t/tags.t

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ subtest 'Verify report' => sub {
134134
ok lives {
135135
ok !$method->has_tag('no_such_tag'),
136136
'has_tag() should tell us if we do not have a given tag'
137-
}, 'and not die';
137+
},
138+
'and not die';
138139
};
139140

140141
subtest 'Verify registry' => sub {

t/test_class_is_not_loaded.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ like(
99
dies {
1010
Test::Class::Moose::Runner->new(
1111
test_classes => ['Test::Class::Not::Loaded'],
12-
)->runtests
12+
)->runtests
1313
},
1414
qr/\QFound the following class that is not a subclass of Test::Class::Moose: Test::Class::Not::Loaded (did you load this class?)/,
1515
'got expected error when trying to run a class which is not loaded'
@@ -25,7 +25,7 @@ like(
2525
dies {
2626
Test::Class::Moose::Runner->new(
2727
test_classes => [ 'Test::Class::Not::Loaded', 'Foo' ],
28-
)->runtests
28+
)->runtests
2929
},
3030
qr/\QFound the following classes that are not subclasses of Test::Class::Moose: Test::Class::Not::Loaded Foo (did you load these classes?)/,
3131
'got expected error when trying to run a class which is not loaded and one which is not a TCM subclass'

0 commit comments

Comments
 (0)