Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37518799
en ru br
ALT Linux repos
S:0.13-alt2

Group :: Development/Perl
RPM: perl-Test-Block

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Test-Block-0.13/000075500000000000000000000000001202342440300133745ustar00rootroot00000000000000Test-Block-0.13/Build.PL000064400000000000000000000007751202342440300147010ustar00rootroot00000000000000use Module::Build;

my $build = Module::Build->new(
module_name => 'Test::Block',
license => 'perl',
requires => {
'perl' => '5.6.1',
'Test::Builder' => '0.17',
'Test::Builder::Tester' => '1.01',
'Test::More' => '0.47',
'Test::Exception' => '0.15',
},
create_makefile_pl => 'traditional',
configure_requires => {
'Module::Build' => 0.38
},
create_readme => 1,
);
$build->create_build_script;
Test-Block-0.13/Changes000064400000000000000000000046461202342440300147010ustar00rootroot00000000000000Revision history for Perl extension Test::Block.

0.13 - 24 Jan 2012
- Marked as depreciated
- Fixed RT#74295 (thanks Andreas Koenig)

0.12
- Moved to github

0.11
- Removed spelling.t, pod.t, signature.t and documented.t from mandatory
tests
- Added a bunch of optional developer tests
- Added reference to Test::Group (thanks to Nadim Khemir)
- Named blocks are now 'quoted' if they're not the default number (thanks
to Nadim Khemir for pointing this out)

0.10
- Can now name a block with a string that maps to false if you want
- Test coverage now at 100% (statement, branch & condition)

0.09
- Moved stuff from build_requires to requires so it works with
CPANPLUS
- Added COMMUNITY section to POD
- Removed a bogus UNIVERSAL::isa just in case somebody wants to
subclass nicely
- Tidied code a little
- Stopped Test::Block accepting some bad plans
- Added Test::Class to SEE ALSO section
- Added link to tada list to the TO DO section of the POD

0.08
- Cosmetic changes to POD

0.07
- Requires Test::Builder::Tester 1.01 so tests will pass with
Test::Simple 0.48.
- New signature file since old key about to be revoked

0.06
- Fixed incorrect comment that 0.05 wasn't released on CPAN (doh!)
- Fixed incorrect README (double doh!)
- Switched to Module::Build so I won't make that darn README
mistake again
- Added signature tests

0.05
- removed blocks declaration
- pod.t now uses Test::Pod
- documented.t now uses Test::Pod::Coverage
- cleaned up code a bit
- now dies if you don't specify the number of tests
- block names default to the block number
- blocks now named NAME => NUM_TESTS

0.04 (not released on CPAN)
- Added named blocks (suggested by Fergal Daly)
- Added all_in_block, builder and block_count class methods
- Added $Plan (suggested by Michael G Schwern)
- Renamed C<expecting> to C<plan> for consistancy
- Rewrote POD

0.03 (not released on CPAN)
- Rewrote as a sane object to avoid evil tie/Hook::LexWrap code :-)

0.02 (not released on CPAN)
- Rewrote so that it would cope with nested blocks

0.01 Mon May 5 21:28:59 2003
- original version; created by h2xs 1.22 with options
--compat-version=5.6.1 --use-new-tests --skip-exporter -APX -n Test::Block

Test-Block-0.13/MANIFEST000064400000000000000000000004551202342440300145310ustar00rootroot00000000000000Build.PL
Changes
lib/Test/Block.pm
Makefile.PL
MANIFEST This list of files
META.json
META.yml
README
t/all_in_block.t
t/bad_args.t
t/block.t
t/class_methods.t
t/developer/documented.t
t/developer/perlcritic.t
t/developer/perlcriticrc
t/developer/pod.t
t/developer/spelling.t
t/import.t
t/variable.t
Test-Block-0.13/META.json000064400000000000000000000022361202342440300150200ustar00rootroot00000000000000{
"abstract" : "DEPRECIATED: Specify fine granularity test plans",
"author" : [
"Adrian Howard <adrianh@quietstars.com>"
],
"dynamic_config" : 1,
"generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.110440",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "Test-Block",
"prereqs" : {
"configure" : {
"requires" : {
"Module::Build" : "0.38"
}
},
"runtime" : {
"requires" : {
"Test::Builder" : "0.17",
"Test::Builder::Tester" : "1.01",
"Test::Exception" : "0.15",
"Test::More" : "0.47",
"perl" : "v5.6.1"
}
}
},
"provides" : {
"Test::Block" : {
"file" : "lib/Test/Block.pm",
"version" : "0.13"
},
"Test::Block::Plan" : {
"file" : "lib/Test/Block.pm",
"version" : 0
}
},
"release_status" : "stable",
"resources" : {
"license" : [
"http://dev.perl.org/licenses/"
]
},
"version" : "0.13"
}
Test-Block-0.13/META.yml000064400000000000000000000013211202342440300146420ustar00rootroot00000000000000---
abstract: 'DEPRECIATED: Specify fine granularity test plans'
author:
- 'Adrian Howard <adrianh@quietstars.com>'
build_requires: {}
configure_requires:
Module::Build: 0.38
dynamic_config: 1
generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.110440'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: Test-Block
provides:
Test::Block:
file: lib/Test/Block.pm
version: 0.13
Test::Block::Plan:
file: lib/Test/Block.pm
version: 0
requires:
Test::Builder: 0.17
Test::Builder::Tester: 1.01
Test::Exception: 0.15
Test::More: 0.47
perl: v5.6.1
resources:
license: http://dev.perl.org/licenses/
version: 0.13
Test-Block-0.13/Makefile.PL000064400000000000000000000007701202342440300153520ustar00rootroot00000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.3800
require 5.006001;
use ExtUtils::MakeMaker;
WriteMakefile
(
'NAME' => 'Test::Block',
'VERSION_FROM' => 'lib/Test/Block.pm',
'PREREQ_PM' => {
'Test::Builder' => '0.17',
'Test::Builder::Tester' => '1.01',
'Test::Exception' => '0.15',
'Test::More' => '0.47'
},
'INSTALLDIRS' => 'site',
'EXE_FILES' => [],
'PL_FILES' => {}
)
;
Test-Block-0.13/README000064400000000000000000000170011202342440300142530ustar00rootroot00000000000000NAME
Test::Block - DEPRECIATED: Specify fine granularity test plans

SYNOPSIS
use Test::More 'no_plan';
use Test::Block qw($Plan);

{
# This block should run exactly two tests
local $Plan = 2;
pass 'first test';
# oops. forgot second test
};

SKIP: {
local $Plan = 3;
pass('first test in second block');
skip "skip remaining tests" => $Plan;
};

ok( Test::Block->all_in_block, 'all test run in blocks' );
is( Test::Block->block_count, 2, 'two blocks ran' );

# This produces...

ok 1 - first test
not ok 2 - block expected 2 test(s) and ran 1
# Failed test (foo.pl at line 6)
ok 3 - first test in second block
ok 4 # skip skip remaining tests
ok 5 # skip skip remaining tests
ok 6 - all test run in blocks
ok 7 - two blocks ran
1..7
# Looks like you failed 1 tests of 7.

DESCRIPTION
NOTE: This module was written before subtests existed in TAP and
Test::More. These days subtests will probably be a better option for
you.

This module allows you to specify the number of expected tests at a
finer level of granularity than an entire test script. It is built with
Test::Builder and plays happily with Test::More and friends.

If you are not already familiar with Test::More now would be the time to
go take a look.

Creating test blocks
Test::Block supplies a special variable $Plan that you can localize to
specify the number of tests in a block like this:

use Test::More 'no_plan';
use Test::Block qw($Plan);

{
local $Plan = 2;
pass('first test');
pass('second test');
};

What if the block runs a different number of tests?
If a block doesn't run the number of tests specified in $Plan then
Test::Block will automatically produce a failing test. For example:

{
local $Plan = 2;
pass('first test');
# oops - forgot second test
};

will output

ok 1 - first test
not ok 2 - block 1 expected 2 test(s) and ran 1

Tracking the number of remaining tests
During the execution of a block $Plan will contain the number of
remaining tests that are expected to run so:

{
local $Plan = 2;
diag "$Plan tests to run";
pass('first test');
diag "$Plan tests to run";
pass('second test');
diag "$Plan tests to run";
};

will produce

# 2 tests to run
ok 1 - first test
# 1 tests to run
ok 2 - second test
# 0 tests to run

This can make skip blocks easier to write and maintain, for example:

SKIP: {
local $Plan = 5;
pass('first test');
pass('second test');
skip "debug tests" => $Plan unless DEBUG > 0;
pass('third test');
pass('fourth test');
skip "high level debug tests" => $Plan unless DEBUG > 2;
pass('fifth test');
};

Named blocks
To make debugging easier you can give your blocks an optional name like
this:

{
local $Plan = { example => 2 };
pass('first test');
# oops - forgot second test
};

which would output

ok 1 - first test
not ok 2 - block example expected 2 test(s) and ran 1

Test::Block objects
The $Plan is implemented using a tied variable that stores and retrieves
Test::Block objects. If you want to avoid the tied interface you can use
Test::Block objects directly.

plan
# create a block expecting 4 tests
my $block = Test::Block->plan(4);

# create a named block with two tests
my $block = Test::Block->plan('test name' => 2);

You create Test::Block objects with the "plan" method. When the
object is destroyed it outputs a failing test if the expected number
of tests have not run.

remaining
You can find out the number of remaining tests in the block by
calling the "remaining" method on the object.

Test::Block objects overload "" and "0+" to return the result of the
remaining method.

builder
Returns Test::Builder object used by Test::Block. For example:

Test::Block->builder->skip('skip a test');

See Test::Builder for more information.

block_count
A class method that returns the number of blocks that have been
created. You can use this to check that the expected number of
blocks have run by doing something like:

is( Test::Block->block_count, 5, 'five blocks run' );

at the end of your test script.

all_in_block
Returns true if all tests so far run have been inside the scope of a
Test::Block object.

ok( Test::Block->all_in_block, 'all tests run in blocks' );

BUGS
None known at the time of writing.

If you find any please let me know by e-mail, or report the problem with
<http://rt.cpan.org/>.

COMMUNITY
perl-qa
If you are interested in testing using Perl I recommend you visit
<http://qa.perl.org/> and join the excellent perl-qa mailing list.
See <http://lists.perl.org/showlist.cgi?name=perl-qa> for details on
how to subscribe.

perlmonks
You can find users of Test::Block, including the module author, on
<http://www.perlmonks.org/>. Feel free to ask questions on
Test::Block there.

CPAN::Forum
The CPAN Forum is a web forum for discussing Perl's CPAN modules.
The Test::Block forum can be found at
<http://www.cpanforum.com/dist/Test-Block>.

AnnoCPAN
AnnoCPAN is a web site that allows community annotations of Perl
module documentation. The Test::Block annotations can be found at
<http://annocpan.org/~ADIE/Test-Block/>.

TO DO
If you think this module should do something that it doesn't (or does
something that it shouldn't) please let me know.

You can see my current to do list at
<http://adrianh.tadalist.com/lists/public/15423>, with an RSS feed of
changes at <http://adrianh.tadalist.com/lists/feed_public/15423>.

ACKNOWLEDGMENTS
Thanks to chromatic and Michael G Schwern for the excellent
Test::Builder, without which this module wouldn't be possible.

Thanks to Michael G Schwern and Tony Bowden for the mails on
perl-qa@perl.org that sparked the idea for this module. Thanks to Fergal
Daly for suggesting named blocks. Thanks to Michael G Schwern for
suggesting $Plan. Thanks to Nadim Khemir for feedback and Andreas Koenig
for spotting bugs.

AUTHOR
Adrian Howard <adrianh@quietstars.com>

If you can spare the time, please drop me a line if you find this module
useful.

SEE ALSO
Test::Group
A framework for grouping related tests in a test suite

Test::Class
Test::Class is an xUnit testing framework for Perl. It allows you to
group tests into methods with independent test plans.

Test::Builder
Support module for building test libraries.

Test::Simple & Test::More
Basic utilities for writing tests.

<http://qa.perl.org/test-modules.html>
Overview of some of the many testing modules available on CPAN.

LICENCE
Copyright 2003-2006 Adrian Howard, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

Test-Block-0.13/lib/000075500000000000000000000000001202342440300141425ustar00rootroot00000000000000Test-Block-0.13/lib/Test/000075500000000000000000000000001202342440300150615ustar00rootroot00000000000000Test-Block-0.13/lib/Test/Block.pm000064400000000000000000000223611202342440300164550ustar00rootroot00000000000000#! /usr/bin/perl

use strict;
use warnings;

package Test::Block;
use base qw(Exporter);

our @EXPORT_OK = qw($Plan);

use Carp;
use Test::Builder;
use Scalar::Util qw( looks_like_number );
use overload
q{""} => \&remaining,
q{0+} => \&remaining,
fallback => 1;

our $VERSION = '0.13';

my $Last_test_in_previous_block = 0;
my $Active_block_count = 0;

my $Test_builder = Test::Builder->new;
sub builder { $Test_builder };

my $Block_count = 0;
sub block_count { $Block_count };

sub plan {
my $class = shift;
my ($expected_tests, $name) = (pop, pop);
croak "need expected number of tests"
unless $expected_tests && $expected_tests =~ /^\d+$/s;
$Block_count++;
$Active_block_count++;
return bless {
name => defined $name ? $name : $Block_count,
expected_tests => $expected_tests,
initial_test => $Test_builder->current_test,
}, $class;
}

sub _tests_run_in_block {
my $self = shift;
return $Test_builder->current_test - $self->{initial_test}
}

sub remaining {
my $self = shift;
return $self->{expected_tests} - _tests_run_in_block($self);
}

sub DESTROY {
my $self = shift;
$Active_block_count--;
$Last_test_in_previous_block = $Test_builder->current_test;
my $expected = $self->{expected_tests};
my $name = $self->{name};
my $tests_ran = _tests_run_in_block($self);
$name = "'$name'" unless looks_like_number( $name );
$Test_builder->ok(
0,
"block $name expected $expected test(s) and ran $tests_ran"
) unless $tests_ran == $expected;
}


my $All_tests_in_block = 1;
sub all_in_block {
return unless $All_tests_in_block;
return 1 if $Active_block_count > 0;
$All_tests_in_block =
$Last_test_in_previous_block == $Test_builder->current_test;
return $All_tests_in_block
}


{
package Test::Block::Plan;
use Tie::Scalar;
use base qw(Tie::StdScalar);

sub STORE {
my ($self, $plan) = @_;
if ( defined($plan) && ! eval { $plan->isa( 'Test::Block' ) } ) {
$plan = Test::Block->plan( ref($plan) ? %$plan : $plan );
};
$self->SUPER::STORE($plan);
}
}

our $Plan;
tie $Plan, 'Test::Block::Plan';

1;
__END__

=head1 NAME

Test::Block - DEPRECIATED: Specify fine granularity test plans

=head1 SYNOPSIS

use Test::More 'no_plan';
use Test::Block qw($Plan);

{
# This block should run exactly two tests
local $Plan = 2;
pass 'first test';
# oops. forgot second test
};

SKIP: {
local $Plan = 3;
pass('first test in second block');
skip "skip remaining tests" => $Plan;
};

ok( Test::Block->all_in_block, 'all test run in blocks' );
is( Test::Block->block_count, 2, 'two blocks ran' );

# This produces...

ok 1 - first test
not ok 2 - block expected 2 test(s) and ran 1
# Failed test (foo.pl at line 6)
ok 3 - first test in second block
ok 4 # skip skip remaining tests
ok 5 # skip skip remaining tests
ok 6 - all test run in blocks
ok 7 - two blocks ran
1..7
# Looks like you failed 1 tests of 7.


=head1 DESCRIPTION

B<NOTE: This module was written before subtests existed in TAP and Test::More. These days subtests will probably be a better option for you.>

This module allows you to specify the number of expected tests at a finer level of granularity than an entire test script. It is built with L<Test::Builder> and plays happily with L<Test::More> and friends.

If you are not already familiar with L<Test::More> now would be the time to go take a look.


=head2 Creating test blocks

Test::Block supplies a special variable C<$Plan> that you can localize to specify the number of tests in a block like this:

use Test::More 'no_plan';
use Test::Block qw($Plan);

{
local $Plan = 2;
pass('first test');
pass('second test');
};

=head2 What if the block runs a different number of tests?

If a block doesn't run the number of tests specified in C<$Plan> then Test::Block will automatically produce a failing test. For example:

{
local $Plan = 2;
pass('first test');
# oops - forgot second test
};

will output

ok 1 - first test
not ok 2 - block 1 expected 2 test(s) and ran 1

=head2 Tracking the number of remaining tests

During the execution of a block C<$Plan> will contain the number of remaining tests that are expected to run so:

{
local $Plan = 2;
diag "$Plan tests to run";
pass('first test');
diag "$Plan tests to run";
pass('second test');
diag "$Plan tests to run";
};

will produce

# 2 tests to run
ok 1 - first test
# 1 tests to run
ok 2 - second test
# 0 tests to run

This can make skip blocks easier to write and maintain, for example:

SKIP: {
local $Plan = 5;
pass('first test');
pass('second test');
skip "debug tests" => $Plan unless DEBUG > 0;
pass('third test');
pass('fourth test');
skip "high level debug tests" => $Plan unless DEBUG > 2;
pass('fifth test');
};


=head2 Named blocks

To make debugging easier you can give your blocks an optional name like this:

{
local $Plan = { example => 2 };
pass('first test');
# oops - forgot second test
};

which would output

ok 1 - first test
not ok 2 - block example expected 2 test(s) and ran 1


=head2 Test::Block objects

The C<$Plan> is implemented using a tied variable that stores and retrieves Test::Block objects. If you want to avoid the tied interface you can use Test::Block objects directly.

=over 4

=item B<plan>

# create a block expecting 4 tests
my $block = Test::Block->plan(4);

# create a named block with two tests
my $block = Test::Block->plan('test name' => 2);

You create Test::Block objects with the C<plan> method. When the object is destroyed it outputs a failing test if the expected number of tests have not run.


=item B<remaining>

You can find out the number of remaining tests in the block by calling the C<remaining> method on the object.

Test::Block objects overload C<""> and C<0+> to return the result of the remaining method.


=item B<builder>

Returns L<Test::Builder> object used by Test::Block. For example:

Test::Block->builder->skip('skip a test');

See L<Test::Builder> for more information.


=item B<block_count>

A class method that returns the number of blocks that have been created. You can use this to check that the expected number of blocks have run by doing something like:

is( Test::Block->block_count, 5, 'five blocks run' );

at the end of your test script.


=item B<all_in_block>

Returns true if all tests so far run have been inside the scope of a Test::Block object.

ok( Test::Block->all_in_block, 'all tests run in blocks' );

=back


=head1 BUGS

None known at the time of writing.

If you find any please let me know by e-mail, or report the problem with L<http://rt.cpan.org/>.


=head1 COMMUNITY

=over 4

=item perl-qa

If you are interested in testing using Perl I recommend you visit L<http://qa.perl.org/> and join the excellent perl-qa mailing list. See L<http://lists.perl.org/showlist.cgi?name=perl-qa> for details on how to subscribe.

=item perlmonks

You can find users of Test::Block, including the module author, on L<http://www.perlmonks.org/>. Feel free to ask questions on Test::Block there.

=item CPAN::Forum

The CPAN Forum is a web forum for discussing Perl's CPAN modules. The Test::Block forum can be found at L<http://www.cpanforum.com/dist/Test-Block>.

=item AnnoCPAN

AnnoCPAN is a web site that allows community annotations of Perl module documentation. The Test::Block annotations can be found at L<http://annocpan.org/~ADIE/Test-Block/>.

=back

=head1 TO DO

If you think this module should do something that it doesn't (or does something that it shouldn't) please let me know.

You can see my current to do list at L<http://adrianh.tadalist.com/lists/public/15423>, with an RSS feed of changes at L<http://adrianh.tadalist.com/lists/feed_public/15423>.


=head1 ACKNOWLEDGMENTS

Thanks to chromatic and Michael G Schwern for the excellent Test::Builder, without which this module wouldn't be possible.

Thanks to Michael G Schwern and Tony Bowden for the mails on perl-qa@perl.org that sparked the idea for this module. Thanks to Fergal Daly for suggesting named blocks. Thanks to Michael G Schwern for suggesting $Plan. Thanks to Nadim Khemir for feedback and Andreas Koenig for spotting bugs.


=head1 AUTHOR

Adrian Howard <adrianh@quietstars.com>

If you can spare the time, please drop me a line if you find this module useful.


=head1 SEE ALSO

=over 4

=item L<Test::Group>

A framework for grouping related tests in a test suite

=item L<Test::Class>

Test::Class is an xUnit testing framework for Perl. It allows you to group tests into methods with independent test plans.

=item L<Test::Builder>

Support module for building test libraries.

=item L<Test::Simple> & L<Test::More>

Basic utilities for writing tests.

=item L<http://qa.perl.org/test-modules.html>

Overview of some of the many testing modules available on CPAN.

=back


=head1 LICENCE

Copyright 2003-2006 Adrian Howard, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

=cut

Test-Block-0.13/t/000075500000000000000000000000001202342440300136375ustar00rootroot00000000000000Test-Block-0.13/t/all_in_block.t000064400000000000000000000010331202342440300164310ustar00rootroot00000000000000use strict;
use warnings;
use Test::More tests => 6;
use Test::Block qw($Plan);

{
local $Plan = 1;
ok( Test::Block->all_in_block, 'true at start');
};
{
local $Plan = 1;
ok( Test::Block->all_in_block, 'true after a block');
};
ok( Test::Block->all_in_block, 'true immediately outside a block');
ok(!Test::Block->all_in_block, 'false after non-block test');
{
local $Plan = 1;
ok( !Test::Block->all_in_block, 'still false in next block');
};
{
local $Plan = 1;
ok( !Test::Block->all_in_block, 'still false in following block');
};
Test-Block-0.13/t/bad_args.t000064400000000000000000000006541202342440300155730ustar00rootroot00000000000000#! /usr/bin/perl

use strict;
use warnings;
use Test::More 'no_plan';
use Test::Exception;

BEGIN { use_ok ('Test::Block') };

dies_ok { Test::Block->plan } 'must specify num tests to run';
dies_ok { Test::Block->plan('foo') }
'value only num tests must be a number';
dies_ok { Test::Block->plan(tests => 'foo') }
'key/value num tests must be a number';
dies_ok { Test::Block->plan('44d') } "44d isn't a number either";Test-Block-0.13/t/block.t000064400000000000000000000020711202342440300151160ustar00rootroot00000000000000use strict;
use warnings;
use Test::Builder::Tester tests => 6;
use Test::More;
use Test::Block;

test_out('ok 1');
{
my $block = Test::Block->plan(1);
ok(1);
}
test_test("count okay");


test_out('ok 1');
test_out('not ok 2 - block 2 expected 2 test(s) and ran 1');
test_fail(+2);
{
my $block = Test::Block->plan(2);
ok(1);
}
test_test("too few tests");


test_out('ok 1');
test_out('ok 2');
test_out('not ok 3 - block 3 expected 1 test(s) and ran 2');
test_fail(+2);
{
my $block = Test::Block->plan(1);
ok(1);
ok(1);
}
test_test("too many tests");


test_out('ok 1');
test_out('ok 2 # skip test');
test_out('ok 3 # skip test');
SKIP: {
my $block = Test::Block->plan(3);
ok(1);
skip "test" => $block->remaining;
}
test_test("works with skipped tests");


test_out('ok 1');
{
my $block = Test::Block->plan(1);
{
my $block = Test::Block->plan(1);
ok(1);
}
}
test_test("nested blocks");

test_out('ok 1');
test_out("not ok 2 - block 'foo' expected 2 test(s) and ran 1");
test_fail(+2);
{
my $block = Test::Block->plan(foo => 2);
ok(1);
}
test_test("named block");
Test-Block-0.13/t/class_methods.t000064400000000000000000000005341202342440300166560ustar00rootroot00000000000000use strict;
use warnings;
use Test::More tests => 5;
use Test::Builder;

BEGIN { use_ok 'Test::Block' };

is( Test::Block->block_count, 0, 'block count initially zero');

SKIP: {
my $block = Test::Block->plan(1);
pass('pass');
};

is( Test::Block->block_count, 1, 'block count updated');
is( Test::Builder->new, Test::Block->builder, 'builder' );Test-Block-0.13/t/developer/000075500000000000000000000000001202342440300156245ustar00rootroot00000000000000Test-Block-0.13/t/developer/documented.t000075500000000000000000000003211202342440300201370ustar00rootroot00000000000000#! /usr/bin/perl -Tw

use strict;
use warnings;

use Test::More;
eval "use Test::Pod::Coverage 1.00";
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
all_pod_coverage_ok();Test-Block-0.13/t/developer/perlcritic.t000064400000000000000000000003401202342440300201460ustar00rootroot00000000000000#! /usr/bin/perl -Tw

use strict;
use warnings;

use Test::More;
eval "use Test::Perl::Critic (-profile => 't/developer/perlcriticrc')";
plan skip_all => "Test::Perl::Critic required for criticism" if $@;
all_critic_ok();


Test-Block-0.13/t/developer/perlcriticrc000064400000000000000000000000001202342440300202220ustar00rootroot00000000000000Test-Block-0.13/t/developer/pod.t000075500000000000000000000002621202342440300165760ustar00rootroot00000000000000#! /usr/bin/perl -Tw

use strict;
use warnings;

use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();
Test-Block-0.13/t/developer/spelling.t000064400000000000000000000007331202342440300176310ustar00rootroot00000000000000#!/usr/bin/perl

use strict;
use warnings;
use Test::More;

my $aspell_path = eval q{
use Test::Spelling;
use File::Which;
which('aspell') || die 'no aspell'
};
plan skip_all => 'Optional Test::Spelling, File::Which and aspell program required to spellcheck POD' if $@;
set_spell_cmd("$aspell_path list");
add_stopwords( <DATA> );
all_pod_files_spelling_ok();

__DATA__
Daly
Fergal
Khemir
Nadim
CPAN
LICENCE
RSS
perlmonks
qa
xUnit
AnnoCPAN
Bowden
ACKNOWLEDGMENTSTest-Block-0.13/t/import.t000064400000000000000000000003311202342440300153330ustar00rootroot00000000000000use strict;
use warnings;
use Test::More tests => 3;

BEGIN { use_ok 'Test::Block', qw($Plan) };

{
local $Plan = 2;
isa_ok( $Plan, 'Test::Block', '$Plan' );
is $Plan, 1, '$Plan holds remaining number of tests';
}
Test-Block-0.13/t/variable.t000064400000000000000000000012071202342440300156110ustar00rootroot00000000000000use strict;
use warnings;
use Test::Builder::Tester tests => 1;
use Test::More;
use Test::Block;

test_out("ok 1 - remaining set");
test_out("not ok 2 - block 'inner' expected 1 test(s) and ran 0");
test_fail(+8);
test_out("ok 3 - remaining updated");
test_out("ok 4 # skip last test");
test_out("ok 5 - block count correct");
SKIP: {
local $Test::Block::Plan = 4;
is( $Test::Block::Plan, 4, 'remaining set' );
{
local $Test::Block::Plan = { inner => 1 };
}
is( $Test::Block::Plan, 2, 'remaining updated' );
skip 'last test', $Test::Block::Plan;
};
is( Test::Block->block_count, 2, 'block count correct');
test_test('$Test::Block::Plan');
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin