Commit | Line | Data |
---|---|---|
26164c8d | 1 | # Your tasks ... |
2 | # | |
78c9c764 | 3 | # First, we will create a set of three new classes to make use of the augment |
4 | # 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 | # |
33204aa6 | 15 | # The Report class should have one read-only attribute: "summary". |
26164c8d | 16 | # |
78c9c764 | 17 | # Finally, the TPSReport class should have three read-only attributes: "t", |
18 | # "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 | # |
78c9c764 | 32 | # This report should be returned as a string from the Document->output method. |
26164c8d | 33 | # |
78c9c764 | 34 | # Don't worry too much about how many newlines separate each item (as long as |
35 | # it's at least one). The test does a little massaging to make this more | |
36 | # forgiving. | |
26164c8d | 37 | # |
538499df | 38 | # Use augment method modifiers in Report and TPSReport to "inject" the |
39 | # relevant content, while Document will output the $title and $author. | |
26164c8d | 40 | |
41 | use strict; | |
42 | use warnings; | |
43 | ||
44 | use lib 't/lib'; | |
45 | ||
46 | use MooseClass::Tests; | |
47 | ||
1338bcf1 | 48 | use Document; |
49 | use Report; | |
538499df | 50 | use TPSReport; |
26164c8d | 51 | |
52 | MooseClass::Tests::tests04(); |