File: multimock.t

package info (click to toggle)
libtest-mockobject-perl 1.20200122-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 216 kB
  • sloc: perl: 1,260; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 338 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use strict;
use warnings;

my $package = 'Test::MockObject';
use Test::More tests => 3;
use_ok( $package );

my $mock = Test::MockObject->new();

$mock->mock(
    foo => sub { 'foo' },
    bar => sub { 'bar' },
);

is( $mock->foo(), 'foo', 'mock one in multi-mock' );
is( $mock->bar(), 'bar', 'mock two in multi-mock' );