NAME

Test::YAFT::Test::Deep::Cmp - Intermediate class for single param comparators

SYNOPSIS

package My::Comparator {
	use parent qw[ Test::YAFT::Test::Deep::Cmp ];

	sub descend {
		my ($self, $got) = @_;

		return $self->_val eq $got;
	}
}

DESCRIPTION

Most of Test::Deep comparators uses only single expected value so little bit of abstraction saves few lines of code.

Constructor

Comparator->new ('Foo')

Methods

_val

Returns expected value provided earlier to constructor

_render_value

Provides additional abstraction to rendering value allowing also $got transformations.

In comparison to default Test::Deep::Cmp implementation this approach allows to write context expectations.

AUTHOR

Branislav Zahradník <barney@cpan.org>

COPYRIGHT AND LICENCE

This module is part of Test::YAFT distribution.