Commit | Line | Data |
afaa1345 |
1 | DIRECTORY CONTENTS |
2 | ================== |
3 | |
ee0589c0 |
4 | This tarball contains exercises for the Intro to Moose class. Here's |
5 | what's what ... |
6 | |
7 | t/*.t - each .t file contains instructions on what the exercise is, |
8 | and runs the tests to check your code. |
9 | |
10 | t/lib - includes a recent copy of the Test-Harness and Test-Simple |
02d94abb |
11 | distributions so we're all on the same page, as well as some other |
12 | modules used in the tests. |
ee0589c0 |
13 | |
14 | t/lib/MooseClass/Tests.pm - the actual tests all live in this |
15 | module. It also shows many examples of how to use Moose's metaclass |
16 | APIs for introspection. |
17 | |
18 | bin/prove - a slightly hacked version of prove that makes sure to look |
19 | in t/lib first. If you have a recent version of prove installed, this |
20 | can be ignored, but it's worth trying if you have any weird problems. |
21 | |
ee0589c0 |
22 | lib - this will be your working directory for most exercises. You'll |
23 | be creating various classes and roles in here, and then testing |
24 | against the test code. |
25 | |
26 | answers - code that passes all the tests for each section. You can |
27 | look in here if you're stuck, or if you just want to see how someone |
afaa1345 |
28 | else did these exercises. |
29 | |
30 | install-moose and moosepan/ - a local CPAN mirror with just Moose and |
31 | its dependencies. See below for usage instructions. |
32 | |
33 | |
34 | INSTALLING MOOSE AND ITS DEPENDENCIES |
35 | ===================================== |
36 | |
37 | This directory contains a partial CPAN mirror that will allow you to |
38 | install Moose and all of its dependencies. Just run: |
39 | |
40 | /path/to/perl install-moose |
41 | |
42 | and it will use this mirror to install the latest version of Moose on |
43 | your system. |
44 | |
45 | This assumes that you have already configured the CPAN shell on your |
46 | system in the past. If you haven't, it may still work, or it may |
47 | prompt you for a bunch of configuration items first. |
48 | |
49 | |
50 | EXERCISES HOW-TO |
51 | ================ |
52 | |
53 | The exercises are all (except for one) designed to be done in the form |
54 | of writing Perl modules and running tests against them. |
55 | |
56 | You will create these modules in the lib/ directory. You will often |
57 | find yourself changing or extending the module you created in a |
58 | previous exercise, so don't delete anything from this directory as you |
59 | go. |
60 | |
61 | The instructions on each exercise are in the associated .t file. |
62 | |
63 | To run the tests, simply run this command: |
64 | |
65 | /path/to/perl bin/prove -lv t/test-name.t |
66 | |
67 | The test file name will be something like 01-classes.t. |
68 | |
69 | The tests will run in verbose mode, so you will get clues as to what |
70 | exactly failed. Keep iterating on your code until the tests pass. |