Experimental Image::BoxFind module:    Image/t/lib/Image/BoxFind/Testing/t/Image-BoxFind-Testing-Eyeballs.t


     # Test file created outside of h2xs framework.
# Run this like so: `perl Image-BoxFind-Testing-Eyeballs.t'
#   doom@kzsu.stanford.edu     2007/10/27 10:20:35

use warnings;
use strict;
$|=1;
my $DEBUG = 1;             # TODO set to 0 before ship
use Data::Dumper;
use File::Basename qw( fileparse );

use FindBin qw( $Bin );
use lib "$Bin/../../../..";

use Test::More;
BEGIN { plan tests => 5 }; # TODO change to 'tests => last_test_to_print';

BEGIN {
  use_ok( 'Image::BoxFind::Testing::Eyeballs', ':all');
}

ok(1, "Traditional: If we made it this far, we're ok.");

# Insert your test code below, the Test::More module is used here so read
# its man page ( perldoc Test::More ) for help writing this test script.

my @image_files =
  (
   "$Bin/dat/images/firefox_save_as.png",
   "$Bin/dat/images/rhythmbox_prefs.png",
   "$Bin/dat/images/gimp_open_dialog.png",
  );

my @via_sub_call;
$via_sub_call[0] =
      define_expect_firefox_save_as();

$via_sub_call[1] =
      define_expect_rhythmbox_prefs();

$via_sub_call[2] =
      define_expect_gimp_open_dialog();

foreach my $i ( 0..2 ){
  my $basename = (  fileparse( $image_files[ $i ], qr{\.png} ) )[0];

  my $via_code_ref = define_expected_via_eyeball( $basename );
  my $via_sub_call = $via_sub_call[ $i ];

  is_deeply( $via_code_ref, $via_sub_call, "Testing that $i worked");
}

     

Joseph Brenner, Tue Nov 27 17:40:02 2007