Test::YAFT::Test::Deep::Cmp - Intermediate class for single param comparators
package My::Comparator { use parent qw[ Test::YAFT::Test::Deep::Cmp ]; sub descend { my ($self, $got) = @_; return $self->_val eq $got; } }
Most of Test::Deep comparators uses only single expected value so little bit of abstraction saves few lines of code.
Test::Deep
Comparator->new ('Foo')
Returns expected value provided earlier to constructor
Provides additional abstraction to rendering value allowing also $got transformations.
$got
In comparison to default Test::Deep::Cmp implementation this approach allows to write context expectations.
Branislav Zahradník <barney@cpan.org>
This module is part of Test::YAFT distribution.
To install Test::YAFT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::YAFT
CPAN shell
perl -MCPAN -e shell install Test::YAFT
For more information on module installation, please visit the detailed CPAN module installation guide.