Skip to content

Commit

Permalink
use FindBin to find the binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Heikki Lehvaslaiho authored and Heikki Lehvaslaiho committed Jun 30, 2012
1 parent 9537887 commit 240b48e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions t/02-cmdline.t
Original file line number Diff line number Diff line change
Expand Up @@ -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', @_);
Expand All @@ -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';

0 comments on commit 240b48e

Please sign in to comment.