2 # Copyright (C) 2007, Parrot Foundation.
9 use Test::More tests => 10;
11 use Parrot::Configure::Messages qw|
15 use IO::CaptureOutput qw| capture |;
17 my $parrot_version = '0.4.10';
18 my $make_version = 'gnu make';
23 sub { $rv = print_introduction($parrot_version); },
26 ok( $rv, "print_introduction() returned true" );
28 # Following test is definitive.
29 like( $stdout, qr/$parrot_version/,
30 "Message included Parrot version number supplied as argument" );
32 # Following tests are NOT definitive. They will break if content of
33 # strings printed by function is changed.
34 like( $stdout, qr/Parrot\sVersion/i, "Message included string 'Parrot version'" );
35 like( $stdout, qr/Configure/i, "Message included string 'Configure'" );
36 like( $stdout, qr/Copyright/i, "Message included copyright notice" );
45 sub { $rv = print_conclusion($pseudo_conf, $make_version); },
48 ok( $rv, "print_conclusion() returned true" );
50 # Following test is definitive.
51 like( $stdout, qr/$make_version/, "Message included make version supplied as argument" );
60 { step => q{init::manifest} },
64 sub { $rv = print_conclusion($pseudo_conf, $make_version); },
67 ok(! defined $rv, "print_conclusion() returned undefined value" );
70 qr/During configuration the following steps failed:.*init::manifest/s,
71 "Got expected message re configuration step failure" );
75 pass("Completed all tests in $0");
77 ################### DOCUMENTATION ###################
81 002-messages.t - test Parrot::Configure::Messages
85 % prove t/configure/components/002-messages.t
89 The files in this directory test functionality used by F<Configure.pl>.
91 The tests in this file test subroutines exported by
92 Parrot::Configure::Messages.
100 Parrot::Configure::Messages, F<Configure.pl>.
106 # cperl-indent-level: 4
109 # vim: expandtab shiftwidth=4: