Link to metacpan, not s.c.o
[gitmo/moose-presentations.git] / moose-class / exercises / t / 03-basic-attributes.t
1 # Your tasks ...
2 #
3 # Go back to your Person class and make the first_name and last_name
4 # attributes required.
5 #
6 # Move the title attribute from the Employee class to the Person
7 # class. Adjust full_name in the Person class so it includes the
8 # title, which is optional.
9 #
10 # Add a predicate (has_title) and clearer (clear_title) to the title
11 # attribute as well.
12 #
13 # If a person has no title, the full_name method should simply return
14 # the first and last name. Use the title's predicate method in the new
15 # full_name method.
16 #
17 # Go back to the Employee class.
18 #
19 # Make the title attribute default to the string 'Worker' for the
20 # Employee class. You can now inherit full_name from the Person class
21 # rather than re-implementing it.
22 #
23 # Add a read-write salary_level attribute. This will be a number from
24 # 1-10 (but you will deal with enforcing this later). This attribute
25 # should default to 1.
26 #
27 # Make the salary attribute read-only. Also make it lazy. The default
28 # should be calculated as salary_level * 10000. Use a builder method
29 # to set the default. Name the builder "_build_salary". This attribute
30 # should not be settable via the constructor.
31 #
32 # Go back to the HasAccount role and make the balance default to 100.
33
34 use strict;
35 use warnings;
36
37 use lib 't/lib';
38
39 use MooseClass::Tests;
40
41 MooseClass::Tests::tests03();