1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/usr/bin/env perl
#
# ordering.pl
#
# Verify that describe blocks are executed in order of definition.
#
########################################################################
#
use Test::Spec;
use FindBin qw($Bin);
BEGIN { require "$Bin/test_helper.pl" };
my $num_contexts = 10;
my $next_expected = 1;
for my $num (1..$num_contexts) {
describe "Context $num" => sub {
it "should run in position $num" => sub {
is $next_expected++, $num;
};
}
};
runtests(@ARGV) unless caller;
|