Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contrive q (Animal)
- => class => Animal::
- => builder => q (new),
- ;
- my $animal = deduce q (Animal);
- # in tests (in new frame generally) you can override your singleton
- subtest ... => sub {
- frame {
- # now we can inject different singleton
- proclaim q (Animal) => Test::Fixture::Animal->new;
- ...
- };
- # and q (Animal) is back
- };
- # Test::YAFT::subtest creates frame for you
- Test::YAFT::subtest ... => sub {
- proclaim ...;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement