Put my name on the title slide
[gitmo/moose-presentations.git] / moose-class / exercises / README
CommitLineData
afaa1345 1DIRECTORY CONTENTS
2==================
3
ee0589c0 4This tarball contains exercises for the Intro to Moose class. Here's
5what's what ...
6
7t/*.t - each .t file contains instructions on what the exercise is,
8and runs the tests to check your code.
9
7485293a 10t/lib - includes a recent (enough) copy of the Test-Harness and Test-Simple
11distributions so we're all on the same page, as well as some other modules
12used in the tests.
ee0589c0 13
14t/lib/MooseClass/Tests.pm - the actual tests all live in this
15module. It also shows many examples of how to use Moose's metaclass
16APIs for introspection.
17
18bin/prove - a slightly hacked version of prove that makes sure to look
19in t/lib first. If you have a recent version of prove installed, this
20can be ignored, but it's worth trying if you have any weird problems.
21
ee0589c0 22lib - this will be your working directory for most exercises. You'll
23be creating various classes and roles in here, and then testing
24against the test code.
25
26answers - code that passes all the tests for each section. You can
27look in here if you're stuck, or if you just want to see how someone
afaa1345 28else did these exercises.
29
30install-moose and moosepan/ - a local CPAN mirror with just Moose and
31its dependencies. See below for usage instructions.
32
33
34INSTALLING MOOSE AND ITS DEPENDENCIES
35=====================================
36
37This directory contains a partial CPAN mirror that will allow you to
38install Moose and all of its dependencies. Just run:
39
40 /path/to/perl install-moose
41
42and it will use this mirror to install the latest version of Moose on
43your system.
44
45This assumes that you have already configured the CPAN shell on your
46system in the past. If you haven't, it may still work, or it may
47prompt you for a bunch of configuration items first.
48
375fa928 49This script may try to connect to the net (even though it shouldn't). If you
63437f86 50are behind a firewall that requires a proxy for http, this may cause the script
375fa928 51to simply hang.
52
53In that case, try setting the "http_proxy" environment variable to appropriate
54value before running the script.
55
56WINDOWS USERS
57============
58
59The above installation script may only work with strawberry perl, and has not
60been tested with ActiveState.
61
62If you are using ActiveState, please install Moose from an appropriate PPM
63repository.
afaa1345 64
65EXERCISES HOW-TO
66================
67
68The exercises are all (except for one) designed to be done in the form
69of writing Perl modules and running tests against them.
70
71You will create these modules in the lib/ directory. You will often
72find yourself changing or extending the module you created in a
73previous exercise, so don't delete anything from this directory as you
74go.
75
76The instructions on each exercise are in the associated .t file.
77
78To run the tests, simply run this command:
79
80 /path/to/perl bin/prove -lv t/test-name.t
81
82The test file name will be something like 01-classes.t.
83
84The tests will run in verbose mode, so you will get clues as to what
85exactly failed. Keep iterating on your code until the tests pass.