Data::Domain::SemanticAdapter::Test - testing Data::Domain objects
version 1.100840
This class can be used to test classes derived from Data::Domain::SemanticAdapter. It works in conjunction with Test::CompanionClasses.
Test data classes usually define TESTDATA() to have arguments without leading dashes. This method munges the args to the usual Data::Domain style by prepending a dash to those keys that don't already start with a dash.
TESTDATA()
So if the TESTDATA() looks like this:
use constant TESTDATA => ( { args => { foo => 1, bar => 'baz' }, valid => [ qw( ... ) ], invalid => [ qw( ... ) ], }, );
the data domain object to be passed will effectively be constructed like this:
$self->make_real_object('-foo' => 1', '-bar' => 'baz');
make_real_object() comes from Test::CompanionClasses::Base.
make_real_object()
Overrides this method by passing the value to be tested to the data domain object's inspect() method and checking that it either returns an empty string or 0.
inspect()
0
Overrides this method by passing the value to be tested to the data domain object's inspect() method and checking that it returns an INVALID message as defined in Data::Domain.
INVALID
Takes a data domain object and a value to be tested. Passes the value to the data domain object's inspect() method and checks whether it returns an EXCLUSION_SET message as defined in Data::Domain.
EXCLUSION_SET
Takes a data domain object and a value to be tested. Passes the value to the data domain object's inspect() method and checks whether it returns an INVALID message as defined in Data::Domain.
This method differs from test_is_invalid() in that the latter is called while iterating over TESTDATA() and so it gets a test name as an argument, while this method can be used for custom tests - it creates its own test name.
test_is_invalid()
Analogous to is_invalid().
is_invalid()
See perlmodinstall for information and options on installing Perl modules.
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Data-Domain-SemanticAdapter.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Data-Domain-SemanticAdapter/.
The development version lives at http://github.com/hanekomu/Data-Domain-SemanticAdapter/. Instead of sending patches, please fork this project using the standard git and github infrastructure.
Marcel Gruenauer <marcel@cpan.org>
This software is copyright (c) 2007 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Domain::SemanticAdapter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Domain::SemanticAdapter
CPAN shell
perl -MCPAN -e shell install Data::Domain::SemanticAdapter
For more information on module installation, please visit the detailed CPAN module installation guide.