Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adjusted tests for calling a method private to a role.
  • Loading branch information
peschwa committed Jan 24, 2014
1 parent 2620680 commit e72febe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions S12-methods/private.t
Expand Up @@ -3,7 +3,7 @@ use Test;
BEGIN { @*INC.push('t/spec/packages/') };
use Test::Util;

plan 13;
plan 16;

# L<S12/Private methods/"Private methods are declared using">

Expand Down Expand Up @@ -70,7 +70,7 @@ dies_ok {$o."b"() }, 'can not call private method via quotes from outside'; #
self!role_shared();
}
method public3 {
self!role_private();
EVAL 'self!role_private();';
}
}

Expand All @@ -79,7 +79,8 @@ dies_ok {$o."b"() }, 'can not call private method via quotes from outside'; #
is $b.public1, 24, '"my method private" can be called as self!private';
is $b.public2, 18, 'can call role shared private methods';
#?niecza todo 'role private methods - spec?'
dies_ok { $b.public3() }, 'can not call role private methods scoped with my';
throws_like { $b.public3() }, X::Method::NotFound,
typename => { m/'B'/ }, method => { m/'role_private'/ }; #'can not call role private methods scoped with my';
}

# RT #101964
Expand Down

0 comments on commit e72febe

Please sign in to comment.