X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F003_p6_example.t;h=bead5703bffda0e4144ed07a3a47b80afc3dd139;hb=244bd352801e30561098541bd2a7313234374810;hp=65845a5eeff378fe2ccc997a5d396bc5e852acc2;hpb=260cc81f7ab424f417900ab1c44b734b339f9d9e;p=gitmo%2FMoose-Autobox.git diff --git a/t/003_p6_example.t b/t/003_p6_example.t index 65845a5..bead570 100644 --- a/t/003_p6_example.t +++ b/t/003_p6_example.t @@ -10,10 +10,16 @@ BEGIN { use_ok('Moose::Autobox'); } +=pod + +This comes from one of the examples in the Pugs distro. + +=cut + { package Units::Bytes; use Moose::Role; - use autobox; + use Moose::Autobox; sub bytes { $_[0] } sub kilobytes { $_[0] * 1024 } @@ -31,18 +37,14 @@ BEGIN { } } -{ - package SCALAR; - use Moose; - with 'Units::Bytes'; -} +Moose::Autobox->mixin_additional_role(SCALAR => 'Units::Bytes'); sub testing_bytes { ::dies_ok { 10->bytes } '... cannot do the autoboxing lexically'; } { - use autobox; + use Moose::Autobox; is(5->bytes, 5, '... got 5 bytes'); is(5->kilobytes, 5120, '... got 5 kilobytes');