in reply to Re: Mocking a method defined in a Moo Role
in thread Mocking a method defined in a Moo Role
#! /usr/bin/perl use Test::Spec; require MyClass; # No use! my $role_foo; { package MyRole; use Moo::Role; sub foo { $role_foo } } describe MyClass => sub { my $o; before each => sub { $o = 'MyClass'->new; }; it 'instantiates' => sub { isa_ok $o, 'MyClass'; }; it 'returns false' => sub { $role_foo = 'false'; is $o->foo('whatever'), 'false'; }; it "isn't sure" => sub { $role_foo = 'true'; is $o->foo('whatever'), 'probably'; }; }; runtests();
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Mocking a method defined in a Moo Role
by PopeFelix (Beadle) on Jun 24, 2016 at 17:59 UTC | |
by PopeFelix (Beadle) on Jun 24, 2016 at 18:25 UTC | |
by choroba (Cardinal) on Jun 24, 2016 at 18:48 UTC | |
by PopeFelix (Beadle) on Jun 28, 2016 at 15:14 UTC |