line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Chai; |
2
|
1
|
|
|
1
|
|
88582
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
22
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
1
|
|
|
1
|
|
6
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
5
|
|
|
|
|
|
|
our $VERSION = "0.01_01"; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
42
|
use Exporter qw/import/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
8
|
|
|
|
|
|
|
our @EXPORT_OK = qw/expect/; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
366
|
use Test::Chai::Assertion; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
17
|
|
11
|
1
|
|
|
1
|
|
572
|
use Test::Chai::Core::Assertions; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
12
|
1
|
|
|
1
|
|
399
|
use Test::Chai::Interface::Expect; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
1; |
15
|
|
|
|
|
|
|
__END__ |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=encoding utf-8 |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Test::Chai - BDD / TDD assertion framework for Perl that can be paired with any testing framework |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use Test::More; |
27
|
|
|
|
|
|
|
use Test::Chai qw/expect/; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
subtest test => sub { |
30
|
|
|
|
|
|
|
expect('test')->to->equal('test'); # ok |
31
|
|
|
|
|
|
|
expect([ 1, 2, 3 ])->to->include(3); # ok |
32
|
|
|
|
|
|
|
expect('test')->to->not->be('Bool'); # ok |
33
|
|
|
|
|
|
|
expect('NaN')->to->be('Int'); # not ok |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
done_testing; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 DESCRIPTION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Test::Chai is BDD / TDD assertion framework inspired by L<Chai|http://chaijs.com/> written by JavaScript. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 LICENSE |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The MIT License (MIT) |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Copyright (c) 2015 Pine Mizune |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
49
|
|
|
|
|
|
|
of this software and associated documentation files (the "Software"), to deal |
50
|
|
|
|
|
|
|
in the Software without restriction, including without limitation the rights |
51
|
|
|
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
52
|
|
|
|
|
|
|
copies of the Software, and to permit persons to whom the Software is |
53
|
|
|
|
|
|
|
furnished to do so, subject to the following conditions: |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in |
56
|
|
|
|
|
|
|
all copies or substantial portions of the Software. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
59
|
|
|
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
60
|
|
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
61
|
|
|
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
62
|
|
|
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
63
|
|
|
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
64
|
|
|
|
|
|
|
THE SOFTWARE. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 AUTHOR |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Pine Mizune E<lt>pine@cpan.org<gt> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |