Skip to content

Commit

Permalink
Added some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Leont committed Mar 21, 2011
1 parent 393e63b commit ed0d38f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/10-basic.t
@@ -0,0 +1,21 @@
#! perl

use strict;
use warnings FATAL => 'all';

use Test::More tests => 3;
use Test::Differences;

use ExtUtils::BuildRC qw/parse_file read_config/;

my $example1 = parse_file('t/files/example1');
eq_or_diff($example1, { install => ['--install_base', '/home/user/perl5'] }, 'parse_file seems to be sane');

{
local $ENV{MODULEBUILDRC} = 't/files/example1';
my $second_try = read_config();
eq_or_diff($second_try, { install => ['--install_base', '/home/user/perl5'] }, 'Reading it from $ENV{MODULEBUILDRC} works too');
}

my $example2 = parse_file('t/files/example2');
eq_or_diff($example2, { install => ['--install_base', '/home/user/perl5', '--prefix', '/home/user'], '*' => [ '--verbose' ] }, 'Embedded newlines are handled too');
1 change: 1 addition & 0 deletions t/files/example1
@@ -0,0 +1 @@
install --install_base /home/user/perl5
3 changes: 3 additions & 0 deletions t/files/example2
@@ -0,0 +1,3 @@
install --install_base /home/user/perl5
--prefix /home/user
* --verbose

0 comments on commit ed0d38f

Please sign in to comment.