Commit | Line | Data |
---|---|---|
26164c8d | 1 | # Your tasks ... |
2 | # | |
538499df | 3 | # First, we will create a set of three new classes to make use of the |
4 | # augment method modifier. The class hierarchy will look like this: | |
26164c8d | 5 | # |
538499df | 6 | # Document |
7 | # | | |
8 | # Report | |
9 | # | | |
10 | # TPSReport | |
26164c8d | 11 | # |
538499df | 12 | # The Document class should have two read-only attributes: "title" and |
13 | # "author". | |
26164c8d | 14 | # |
538499df | 15 | # The Report class should have one read-only attributes: "summary". |
26164c8d | 16 | # |
538499df | 17 | # Finally, the TPSReport class should have three read-only attributes: |
18 | # "t", "p", and "s". | |
26164c8d | 19 | # |
538499df | 20 | # The goal is to produce a report that looks this: |
26164c8d | 21 | # |
538499df | 22 | # $title |
26164c8d | 23 | # |
538499df | 24 | # $summary |
26164c8d | 25 | # |
538499df | 26 | # t: $t |
27 | # p: $p | |
28 | # s: $s | |
26164c8d | 29 | # |
538499df | 30 | # Written by $author |
26164c8d | 31 | # |
538499df | 32 | # This report will be a string returned by the Document->output |
33 | # method. | |
26164c8d | 34 | # |
538499df | 35 | # Don't worry too much about how many newlines separate each item (as |
36 | # long as it's at least one). The test does a little massaging to make | |
37 | # this more forgiving. | |
26164c8d | 38 | # |
538499df | 39 | # Use augment method modifiers in Report and TPSReport to "inject" the |
40 | # relevant content, while Document will output the $title and $author. | |
26164c8d | 41 | |
42 | use strict; | |
43 | use warnings; | |
44 | ||
45 | use lib 't/lib'; | |
46 | ||
47 | use MooseClass::Tests; | |
48 | ||
538499df | 49 | use TPSReport; |
26164c8d | 50 | |
51 | MooseClass::Tests::tests04(); |