Permalink
Browse files

Merge branch 'feature/list_precedence' into develop

  • Loading branch information...
2 parents c39eaa4 + 5dd0f8a commit 56d4bbfd4612a9b117a8bcb4f8bea54152ae4fbe Philip Garrett committed Apr 14, 2012
Showing with 23 additions and 8 deletions.
  1. +23 −8 t/runtests_subset.t
View
@@ -12,45 +12,60 @@ BEGIN { require "$Bin/test_helper.pl" };
describe "Test::Spec" => sub {
- describe "when no specific tests are requested" => sub {
+ describe "when no specific examples are requested" => sub {
my $tap;
before all => sub {
$tap = capture_tap("subset_spec.pl");
};
- it "should run all the tests" => sub {
+ it "should run all the examples" => sub {
like $tap, qr/^ok \d+ - Test One.*ok \d+ - Test Two/ms;
};
};
- describe "when specific tests are requested explicitly" => sub {
+ describe "when specific examples are requested explicitly" => sub {
my $tap;
before all => sub {
# case insensitivity is baked in
$tap = capture_tap("subset_spec.pl", "oNe");
};
- it "should run the requested tests" => sub {
+ it "should run the requested examples" => sub {
like $tap, qr/^ok \d+ - Test One/;
};
- it "should run ONLY the requested tests" => sub {
+ it "should run ONLY the requested examples" => sub {
unlike $tap, qr/^ok \d+ - Test Two/;
};
};
- describe "when specific tests are requested via SPEC environment var" => sub {
+ describe "when specific examples are requested via SPEC environment var" => sub {
my $tap;
before all => sub {
# case insensitivity is baked in
local $ENV{SPEC} = "oNe";
$tap = capture_tap("subset_spec.pl");
};
- it "should run the requested tests" => sub {
+ it "should run the requested examples" => sub {
like $tap, qr/^ok \d+ - Test One/;
};
- it "should run ONLY the requested tests" => sub {
+ it "should run ONLY the requested examples" => sub {
unlike $tap, qr/^ok \d+ - Test Two/;
};
};
+ describe "when examples are requested via both SPEC and explicit parameter" => sub {
+ my $tap;
+ before all => sub {
+ # case insensitivity is baked in
+ local $ENV{SPEC} = "oNe";
+ $tap = capture_tap("subset_spec.pl","tWo");
+ };
+ it "should run the explicit example" => sub {
+ like $tap, qr/^ok \d+ - Test Two/;
+ };
+ it "should *not* run the SPEC example" => sub {
+ unlike $tap, qr/^ok \d+ - Test One/;
+ };
+ };
+
};
runtests unless caller;

0 comments on commit 56d4bbf

Please sign in to comment.