HTML-Mason
view release on metacpan or search on metacpan
lib/HTML/Mason/Tests.pm view on Meta::CPAN
}
sub _write_shared_comps
{
my $self = shift;
return unless @SHARED;
foreach my $comp ( @SHARED )
{
my @path = split m(/), $comp->{path};
my $file = pop @path;
my $dir = File::Spec->catdir( $self->comp_root, @path );
$self->write_comp( $comp->{path}, $dir, $file, $comp->{component} );
}
}
sub _write_support_comps
{
my $self = shift;
unless ( @{ $self->{support} } )
{
$Test->diag( "No support comps to create\n" ) if $DEBUG;
return;
}
foreach my $supp ( @{ $self->{support} } )
{
my @path = split m(/), $supp->{path};
my $file = pop @path;
my $dir = File::Spec->catdir( $self->comp_root, $self->{name}, @path );
$self->write_comp( $supp->{path}, $dir, $file, $supp->{component} );
}
}
sub _write_test_comp
{
my $self = shift;
my $test = $self->{current_test};
my @path = split m(/), $test->{path};
my $file = pop @path;
my $dir = File::Spec->catdir( $self->comp_root, $self->{name}, @path );
unless ( -d $dir )
{
$Test->diag( "Making dir: $dir\n" ) if $DEBUG;
mkpath( $dir, 0, 0755 )
or die "Unable to create directory '$dir': $!";
}
( run in 0.891 second using v1.01-cache-2.11-cpan-71847e10f99 )