File: shared_examples_spec.pl

package info (click to toggle)
libtest-spec-perl 0.54-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 308 kB
  • sloc: perl: 2,502; makefile: 2
file content (61 lines) | stat: -rwxr-xr-x 1,760 bytes parent folder | download | duplicates (5)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env perl
#
# shared_examples_spec.pl
#
# Test cases for Test::Spec shared example definition and inclusion.
# Generates TAP to be checked by shared_examples.t
#
########################################################################
#
package Testcase::Spec::SharedExamplesSpec;
use Test::Spec;
use FindBin qw($Bin);
BEGIN { require "$Bin/test_helper.pl" };

shared_examples_for "example group" => sub {
  it "can take at least one example";
  it "can take more than one example";
  describe "with an inner block" => sub {
    it "nests properly";
  };
};

describe "A context" => sub {
  # can define an example group.
  shared_examples_for "example group defined in context" => sub {
    it "executes";
  };
};

describe "A context importing an example group" => sub {
  it_should_behave_like "example group";
  it_should_behave_like "example group defined in context";
  it "can have custom behavior";
};

describe "Another context" => sub {
  describe "importing an example group" => sub {
    it_should_behave_like "example group";
    it "can have custom behavior, too";
  };
  it "can have behavior that doesn't interfere with example groups in sub-contexts";
};

describe "Another context" => sub {
  describe "importing an example group" => sub {
    it "accumulates examples in the same way that describe() does";
  };
};

shared_examples_for "example group" => sub {
  it "can be reopened";
};


# A context importing an example group can take at least one example
# A context importing an example group can take more than one example
# A context importing an example group can be reopened
# A context importing an example group with an inner block nests properly
# A context importing an example group executes

runtests unless caller;