~ubuntu-branches/ubuntu/trusty/libtest-roo-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/lib/EachTest.pm

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2014-01-14 19:25:11 UTC
  • Revision ID: package-import@ubuntu.com-20140114192511-9ycl4dc1zgamfnek
Tags: upstream-1.002
ImportĀ upstreamĀ versionĀ 1.002

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package EachTest;
 
2
use Test::Roo::Role;
 
3
 
 
4
has counter => (
 
5
    is      => 'rw',
 
6
    lazy    => 1,
 
7
    builder => 1,
 
8
);
 
9
 
 
10
requires '_build_counter';
 
11
 
 
12
before each_test => sub {
 
13
    my $self = shift;
 
14
    pass("starting before module modifier");
 
15
    $self->counter( $self->counter + 1 );
 
16
};
 
17
 
 
18
after each_test => sub {
 
19
    my $self = shift;
 
20
    $self->counter( $self->counter - 1 );
 
21
    pass("finishing after module modifier");
 
22
};
 
23
 
 
24
test 'positive' => sub { ok( shift->counter, "counter positive" ) };
 
25
 
 
26
1;