Skip to content

Commit

Permalink
make sure make sure t doesn't get clobbered. Add myself to authors. a…
Browse files Browse the repository at this point in the history
…mend documentation doesn't get clobbered. Add myself to authors. amend documentation
  • Loading branch information
dams committed Sep 8, 2011
1 parent 5f97f6b commit 8911edc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Mo.pm
Expand Up @@ -12,6 +12,6 @@ sub import {
push @{$p.'::ISA'}, $_[0];
}

sub new { $_ = bless { @_[1..$#_] }, $_[0]; $_->can('BUILD') && $_->BUILD; $_ }
sub new { my $s = bless { @_[1..$#_] }, $_[0]; $s->can('BUILD') && $s->BUILD; $s }

1;
11 changes: 10 additions & 1 deletion lib/Mo.pod
Expand Up @@ -10,15 +10,24 @@ Mo - Micro Objects
use Mo 'Cow Bell';
extends 'SNL';

has noise => (is =>'ro');
has noise;

sub BUILD {
my $self = shift;
$self->SUPER::BUILD();
# ...
}

=head1 DESCRIPTION

Moose led to Mouse led to Moo led to Mo. M, anyone?

This is a minimalistic object oriented sugar.

=head1 AUTHOR

Ingy döt Net <ingy@cpan.org>
Damien 'dams' Krotkine <dams@cpan.org>

=head1 COPYRIGHT AND LICENSE

Expand Down
4 changes: 3 additions & 1 deletion t/test.t
@@ -1,4 +1,4 @@
use Test::More tests => 8;
use Test::More tests => 9;

package Foo;
use Mo;
Expand Down Expand Up @@ -54,6 +54,8 @@ is $bar->this, 'thang', 'Write works';
my $baz = Baz->new;
is $baz->foo, 5, 'BUILD works';

$_ = 5;
my $maz = Maz->new;
is $_, 5, '$_ is untouched';
is $maz->foo, 5, 'BUILD works again';
is $maz->bar, 7, 'BUILD works in parent class';
20 changes: 20 additions & 0 deletions t/use_ok.t
@@ -0,0 +1,20 @@
use Test::More;
use File::Find;

my %skip = map {($_, 1)} qw{};

my @modules = ();
File::Find::find(sub {
return unless -f $_ and $_ =~ /\.pm$/;
my $module = $File::Find::name;
$module =~ s!lib[\/\\](.*)\.pm$!$1!;
$module =~ s!/+!::!g;
return if $skip{$module};
push @modules, $module;
}, 'lib');

plan tests => scalar(@modules);

for my $module (sort @modules) {
use_ok $module;
}

0 comments on commit 8911edc

Please sign in to comment.