Slide 100
Slide 100 text
use Test::Mock::Guard qw(mock_guard);
my $guard = mock_guard( 'MyApp::Schema::Row::User', {
'take_something' => sub {
return +{
foo => 1,
bar => 2,
}
},
} );
is_deeply(
$user->take_something,
{
foo => 1,
bar => 2,
}
);
is $guard->call_count( 'MyApp::Schema::Row::User', 'take_something' ), 1;
$guard ͕ scope ͷதͰଘ
ࡏ͢Δ͚࣌ͩϝιουͷڍಈ
Λࠩ͠ସ͑Δ
ݺΕͨճΛς
ετ