ETL::Pipeline::Output::UnitTest - Output destination for unit tests
use ETL::Pipeline; ETL::Pipeline->new( { input => ['UnitTest'], mapping => {First => 'Header1', Second => 'Header2'}, output => ['UnitTest'] } )->process;
ETL::Pipeline::Output::UnitTest is an output destination used by the unit tests. It proves that the ETL::Pipeline::Output role works. You should not use this destination in production code - only unit tests.
The data is stored in memory. The class provides methods to access the saved records.
None - there's no configuration for this destination. It's meant to be quick and light for unit testing.
In ETL::Pipeline::Output::UnitTest, a record is a hash reference. records stores a list of record (hash references). The list survives after calling "finish". This allows you to check the results of a test after calling "process" in ETL::Pipeline.
The list is cleared after calling "configure".
Returns a list of all the records. It dereferences "records".
Prevents further storage of records. "write" will throw a fatal exception if it is called after close. This helps ensure that everything runs in the proper order.
Returns a single record from storage. Useful to check the values and make sure things were added in the correct order. It returns the ame hash reference passed into "write".
Returns the count of records currently in storage.
Allows storage of records. "write" will throw a fatal exception if it is called before open. This helps ensure that everything runs in the proper order.
Add the current record into the "records" attribute. Unit tests can then check what was saved, to make sure the pipeline completed.
ETL::Pipeline, ETL::Pipeline::Output, ETL::Pipeline::Input::UnitTest
Robert Wohlfarth <robert.j.wohlfarth@vumc.org>
Copyright 2021 (c) Vanderbilt University
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install ETL::Pipeline, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ETL::Pipeline
CPAN shell
perl -MCPAN -e shell install ETL::Pipeline
For more information on module installation, please visit the detailed CPAN module installation guide.