#!perl use strict; use warnings; use v5.10.0; use Test::More tests => "5"; use FindBin qw($Bin); BEGIN { use_ok( 'Fancy::Open', qw(fancy_open) ) or die "Fancy::Open is not available\n"; } diag( "Testing Fancy::Open $Fancy::Open::VERSION, Perl $], $^X" ); my $file = "$Bin/test-open.txt"; my @wanted = qw( red orange yellow spring green teal cyan azure blue violet magenta pink white black gray ); is_deeply( [ Fancy::Open::fancy_open($file) ], [ @wanted ], "testing a plain array" ); is_deeply( [ Fancy::Open::fancy_open($file, { 'before' => 'solid ' }) ], [ map "solid $_", @wanted ], "testing an array with before option" ); is_deeply( [ Fancy::Open::fancy_open($file, { 'after' => ' bead' }) ], [ map "$_ bead", @wanted ], "testing an array with after option" ); is_deeply( [ Fancy::Open::fancy_open($file, { 'before' => 'solid ', 'after' => ' bead' }) ], [ map "solid $_ bead", @wanted ], "testing an array with before and after options" ); done_testing();