[Bps-public-commit] r11220 - in WebChart/t/lib: WebChart

sunnavy at bestpractical.com sunnavy at bestpractical.com
Wed Mar 26 22:11:32 EDT 2008


Author: sunnavy
Date: Wed Mar 26 22:11:32 2008
New Revision: 11220

Added:
   WebChart/t/lib/
   WebChart/t/lib/WebChart/
   WebChart/t/lib/WebChart/Test.pm

Log:
added t/lib/WebChart/Test.pm

Added: WebChart/t/lib/WebChart/Test.pm
==============================================================================
--- (empty file)
+++ WebChart/t/lib/WebChart/Test.pm	Wed Mar 26 22:11:32 2008
@@ -0,0 +1,25 @@
+package WebChart::Test;
+use strict;
+use warnings;
+use Test::More;
+use base 'Exporter';
+
+our @EXPORT_OK = qw/is_file/;
+
+sub is_file {
+    my ( $get, $expected, $comment ) = @_;
+
+    $get = _read_file( $get );
+    $expected = _read_file( $expected );
+    return is( $get, $expected, $comment )
+}
+
+
+sub _read_file {
+    local $/;
+    my $file = shift;
+    open my $fh, '<', $file or die "can't open file $file to read: $!";
+    return <$fh>;
+}
+
+1;



More information about the Bps-public-commit mailing list