The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Stream::Compare::Object - Representation of an object during deep comparison.

EXPERIMENTAL CODE WARNING

This is an experimental release! Test-Stream, and all its components are still in an experimental phase. This dist has been released to cpan in order to allow testers and early adopters the chance to write experimental new tools with it, or to add experimental support for it into old tools.

PLEASE DO NOT COMPLETELY CONVERT OLD TOOLS YET. This experimental release is very likely to see a lot of code churn. API's may break at any time. Test-Stream should NOT be depended on by any toolchain level tools until the experimental phase is over.

DESCRIPTION

This class lets you specify an expected object in a deep comparison. You can check the fields/elements of the underlying reference, call methods to verify results, and do meta checks for object type and ref type.

METHODS

$class = $obj->meta_class

The meta-class to be used when checking the object type. This is mainly listed because it is useful to override for specialized object subclasses.

This normally just returns Test::Stream::Compare::Meta.

$class = $obj->object_base

The base-class to be expected when checking the object type. This is mainly listed because it is useful to override for specialized object subclasses.

This normally just returns 'UNIVERSAL'.

$obj->add_prop(...)

Add a meta-propery to check, see Test::Stream::Compare::Meta. This method just delegates.

$obj->add_field(...)

Add a hash-field to check, see Test::Stream::Compare::Hash. This method just delegates.

$obj->add_item(...)

Add an array item to check, see Test::Stream::Compare::Array. This method just delegates.

$obj->add_call($method, $check)
$obj->add_call($method, $check, $name)

Add a method call check. This will call the specified method on your object and verify the result. $method may be a method name, or a coderef. In the case of a coderef it can be helpful to provide an alternate name. When no name is provided the name is either $method or the string '\&CODE'.

SOURCE

The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2015 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html