Permalink
Browse files

Fix feed() and pet(), add tests. Fixes GH-2

  • Loading branch information...
1 parent 8f529e6 commit 2a2a9f92c47302f45f92c2fe3072a3727a463ea2 @tadzik committed Aug 15, 2012
Showing with 6 additions and 3 deletions.
  1. +3 −3 lib/Acme/Meow.pm
  2. +3 −0 t/01-fun.t
View
@@ -3,13 +3,13 @@ use v6;
#= Our cute, artificial cat (perfect for allergics!)
class Acme::Meow {
- has Int $!love = 0;
- has Str $!fav = '';
+ has Numeric $!love = 0;
+ has Str $!fav = '';
#= pet our kitty
method pet {
$!love++;
- $!fav = pick(<milk nip>);
+ $!fav = <milk nip>.pick;
say ~[self!kitty_status, <purr nuzzle meow>.pick,
$!love > 15 ?? '<3' !! ''];
}
View
@@ -7,4 +7,7 @@ my $c = Acme::Meow.new;
ok $c.can('feed'), 'We can feed the cat';
ok $c.can('pet'), 'We can pet the cat';
+lives_ok { $c.feed }, 'feeding works';
+lives_ok { $c.pet }, 'petting works';
+
done;

0 comments on commit 2a2a9f9

Please sign in to comment.