Test::Approvals::Core::FileApprover - Verify two files are the same
This documentation refers to Test::Approvals::Core::FileApprover version v0.0.4
use Test::Approvals::Core::FileApprover qw(verify); use Test::Approvals::Namers::DefaultNamer; use Test::Approvals::Writers::TextWriter; use Test::Approvals::Reporters; my $w = Test::Approvals::Writers::TextWriter->new( result => 'Hello' ); my $r = Test::Approvals::Reporters::DiffReporter->new(); my $n = Test::Approvals::Namers::DefaultNamer->new( name => 'Hello Test' ); ok verify( $w, $n, $r ), $n->name;
This module provides the low level routines that actually compare two files for equality, and take the appropriate actions when the files don't match (ie. launch the reporter) and when the files do match (ie. clean up the received file).
ok verify( $writer, $namer, $rerporter ), $namer->name;
Low level method to verify that the result data matches the approved data (stored in a file). Returns a value indicating whether the data matches and invokes the reporter when needed.
my $failure = verify_files('r.txt', 'a.txt'); if(defined $failure) { print "Verification failed because: $failure"; } else { pring "Verification success!"; }
Compare two files and return a message if they are not the same. When they are the same, return null.
None at this time.
None.
Exporter File::Compare Readonly Test::Builder version
None known.
Windows-only. Linux/OSX/other support will be added when time and access to those platforms permit.
Jim Counts - @jamesrcounts
Copyright (C) 2013 Jim Counts
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
L<http://www.apache.org/licenses/LICENSE-2.0>
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
To install Test::Approvals, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Approvals
CPAN shell
perl -MCPAN -e shell install Test::Approvals
For more information on module installation, please visit the detailed CPAN module installation guide.