Skip to content

Commit

Permalink
Merge 6418323 into 218af5c
Browse files Browse the repository at this point in the history
  • Loading branch information
bayashi committed Feb 28, 2020
2 parents 218af5c + 6418323 commit 210941a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
12 changes: 0 additions & 12 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This is Perl module B<Test::Arrow>. It's Object-Oriented testing library.

my $arr = Test::Arrow->new;

$arr->ok(1);
$arr->got(1)->ok;

$arr->expect(uc 'foo')->to_be('FOO');
Expand All @@ -33,17 +32,6 @@ This is Perl module B<Test::Arrow>. It's Object-Oriented testing library.
->got('abc')
->like;

# `unlike` shows where a place could have matched if it's failed
$arr->name('Unlike Fail example')
->expected(qr/b/)
->got('abc')
->unlike;
# Failed test 'Unlike Fail example'
# at t/unlike.t line 12.
# 'abc'
# matches '(?^:b)'
# matched at line: 1, offset: 2

$arr->warnings(sub { warn 'Bar' })->catch(qr/^Ba/);
$arr->throw(sub { die 'Baz' })->catch(qr/^Ba/);

Expand Down
32 changes: 17 additions & 15 deletions lib/Test/Arrow.pm
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ Test::Arrow - Object-Oriented testing library
my $arr = Test::Arrow->new;
$arr->ok(1);
$arr->got(1)->ok;
$arr->expect(uc 'foo')->to_be('FOO');
Expand All @@ -505,17 +504,6 @@ Test::Arrow - Object-Oriented testing library
->got('abc')
->like;
# `unlike` shows where a place could have matched if it's failed
$arr->name('Unlike Fail example')
->expected(qr/b/)
->got('abc')
->unlike;
# Failed test 'Unlike Fail example'
# at t/unlike.t line 12.
# 'abc'
# matches '(?^:b)'
# matched at line: 1, offset: 2
$arr->warnings(sub { warn 'Bar' })->catch(qr/^Ba/);
$arr->throw(sub { die 'Baz' })->catch(qr/^Ba/);
Expand Down Expand Up @@ -615,15 +603,15 @@ More easy,
Similar to C<is> and C<isnt> compare values with C<eq> and C<ne>.
$arr->expect('FOO')->got(uc 'foo')->is;
$arr->expected('FOO')->got(uc 'foo')->is;
=head3 is_num
=head3 isnt_num
Similar to C<is_num> and C<isnt_num> compare values with C<==> and C<!=>.
$arr->expect(6)->got( 2 * 3 )->is_num;
$arr->expected(6)->got( 2 * 3 )->is_num;
=head3 to_be($got)
Expand All @@ -637,7 +625,21 @@ The $got will be compare with expected value.
C<like> matches $got value against the $expected regex.
$arr->expect(qr/b/)->got('abc')->like;
$arr->expected(qr/b/)->got('abc')->like;
Works exactly as C<like>, only it checks if $got does not match the expected pattern.
C<unlike> shows where a place could have matched if it's failed like below.
$arr->name('Unlike Fail example')
->expected(qr/b/)
->got('abc')
->unlike;
# Failed test 'Unlike Fail example'
# at t/unlike.t line 12.
# 'abc'
# matches '(?^:b)'
# matched at line: 1, offset: 2
=head3 can_ok($class, @methods)
Expand Down

0 comments on commit 210941a

Please sign in to comment.