Cisco-Reconfig

 view release on metacpan or  search on metacpan

t/banner2.t  view on Meta::CPAN

#!/usr/bin/perl -I. -w

use Cisco::Reconfig;
use Test;
use Carp qw(verbose);
use Scalar::Util qw(weaken);

use strict;

my $debugdump = 0;

if ($debugdump) {
	$Cisco::Reconfig::nonext = 1;
}

BEGIN { plan test => 6 };

sub wok
{
	my ($a, $b) = @_;
	require File::Slurp;
	import File::Slurp;
	write_file('x', $a);
	write_file('y', $b);
	return ok($a,$b);
}

my $config = readconfig(\*DATA);

if ($debugdump) {
	require File::Slurp;
	require Data::Dumper;
	import File::Slurp;
	import Data::Dumper;
	$Data::Dumper::Sortkeys = 1;
	$Data::Dumper::Sortkeys = 1;
	$Data::Dumper::Terse = 1;
	$Data::Dumper::Terse = 1;
	$Data::Dumper::Indent = 1;
	$Data::Dumper::Indent = 1;
	write_file("dumped", Dumper($config));
	exit(0);
}

ok(defined $config);

# -----------------------------------------------------------------
{

my $x = $config->get('banner motd');
#undef $config;
#use Data::Dumper;
#print Dumper($x);
#exit(0);
ok($x->subs->text, <<'END');
                                       _      _     ___ ____
 _ __ ___   ___ ___ ___  _ __ _ __ ___ (_) ___| | __/ _ \___ \       ___ ___
| '_ ` _ \ / __/ __/ _ \| '__| '_ ` _ \| |/ __| |/ / | | |__) |____ / __/ _ \
| | | | | | (_| (_| (_) | |  | | | | | | | (__|   <| |_| / __/_____| (_|  __/
|_| |_| |_|\___\___\___/|_|  |_| |_| |_|_|\___|_|\_\\___/_____|     \___\___|


This system and data is the property of blah blah
blah...
^C
END



( run in 1.915 second using v1.01-cache-2.11-cpan-9169edd2b0e )