From 240b48ea0a676b1bd3f10e8782534d534f6bfe48 Mon Sep 17 00:00:00 2001 From: Heikki Lehvaslaiho Date: Sat, 30 Jun 2012 12:07:27 +0300 Subject: [PATCH] use FindBin to find the binary --- t/02-cmdline.t | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/t/02-cmdline.t b/t/02-cmdline.t index 3988fd6..b52bc9b 100644 --- a/t/02-cmdline.t +++ b/t/02-cmdline.t @@ -3,6 +3,7 @@ use Test::More tests => 5; use Data::Dumper; use File::Spec; +use FindBin qw($Bin); sub test_input_file { return File::Spec->catfile('t', 'data', @_); @@ -11,14 +12,14 @@ sub test_input_file { diag( "Testing spipe from command line" ); my $conffile = test_input_file('string_manipulation.yml'); -ok `bin/spipe 2>&1` =~ /ERROR/, 'die without config' ; -ok `bin/spipe -v` =~ /spipe, version /, '--version' ; -ok `bin/spipe -help` =~ /User Contributed Perl Documentation/, '--help' ; -ok `bin/spipe -conf $conffile -debug --verbose=-1` =~ /s1/, '--debug' ; +ok `$Bin/../bin/spipe 2>&1` =~ /ERROR/, 'die without config' ; +ok `$Bin/../bin/spipe -v` =~ /spipe, version /, '--version' ; +ok `$Bin/../bin/spipe -help` =~ /User Contributed Perl Documentation/, '--help' ; +ok `$Bin/../bin/spipe -conf $conffile -debug --verbose=-1` =~ /s1/, '--debug' ; unlink 'config.yml', 'pipeline.log'; $conffile = test_input_file('input.yml'); -`spipe -conf $conffile --input=ABC --itype=unnamed --verbose=-1`; +`$Bin/../bin/spipe -conf $conffile --input=ABC --itype=unnamed --verbose=-1`; is `cat s1_string.txt`, "ABC\n", 'command line input'; `cat s1_string.txt`; unlink 'config.yml', 'pipeline.log', 's1_string.txt';