Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 2a2a9f92c47302f45f92c2fe3072a3727a463ea2 1 parent 8f529e6
@tadzik authored
Showing with 6 additions and 3 deletions.
  1. +3 −3 lib/Acme/Meow.pm
  2. +3 −0  t/01-fun.t
View
6 lib/Acme/Meow.pm
@@ -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
3  t/01-fun.t
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.