Skip to content

Commit

Permalink
better example
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Duggan committed May 5, 2016
1 parent 015c6da commit 3e0c33c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions S26-documentation/block-trailing.t
Expand Up @@ -72,19 +72,19 @@ test-trailing(&panther, 'pink');
class Sheep {
#={a sheep}
has $.wool; #={usually white}
has $.wolf = 'big bad'; #=(a predator)
has $.sound = 'baa'; #=(usually quiet)

method roar { 'roar!' }
#={not too scary}
}

{
my $wool-attr = Sheep.^attributes.grep({ .name eq '$!wool' })[0];
my $wolf-attr = Sheep.^attributes.grep({ .name eq '$!wolf' })[0];
my $sound-attr = Sheep.^attributes.grep({ .name eq '$!sound' })[0];
my $roar-method = Sheep.^find_method('roar');
test-trailing(Sheep, 'a sheep');
test-trailing($wool-attr, 'usually white');
test-trailing($wolf-attr, 'a predator');
test-trailing($sound-attr, 'usually quiet');
test-trailing($roar-method, 'not too scary');
}

Expand Down
6 changes: 3 additions & 3 deletions S26-documentation/why-trailing.t
Expand Up @@ -64,19 +64,19 @@ test-trailing(&panther, 'pink');
class Sheep {
#= a sheep
has $.wool; #= usually white
has $.wolf is rw = "bad"; #= a predator
has $.sound is rw = "baa"; #= usually quiet

method roar { 'roar!' }
#= not too scary
}

{
my $wool-attr = Sheep.^attributes.grep({ .name eq '$!wool' })[0];
my $wolf-attr = Sheep.^attributes.grep({ .name eq '$!wolf' })[0];
my $sound-attr = Sheep.^attributes.grep({ .name eq '$!sound' })[0];
my $roar-method = Sheep.^lookup('roar');
test-trailing(Sheep, 'a sheep');
test-trailing($wool-attr, 'usually white');
test-trailing($wolf-attr, 'big bad wolf');
test-trailing($sound-attr, 'usually quiet');
test-trailing($roar-method, 'not too scary');
}

Expand Down

0 comments on commit 3e0c33c

Please sign in to comment.