Created
November 12, 2019 15:35
-
-
Save j1n3l0/007c76f8d4d390b750b1894ff50fe901 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test2::V0; | |
package Demo::A { | |
use Moo; | |
has attr => ( | |
is => 'lazy', | |
builder => sub { __PACKAGE__ }, | |
); | |
}; | |
package Demo::B { | |
use Moo; | |
extends 'Demo::A'; | |
sub _build_attr { __PACKAGE__ } | |
}; | |
subtest builder => sub { | |
is( | |
Demo::B->new, | |
object { call attr => 'Demo::B' }, | |
'should use the correct builder', | |
); | |
}; | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment