Dist-Zilla-Plugin-PodLoom

 view release on metacpan or  search on metacpan

t/10-podloom.t  view on Meta::CPAN

#! /usr/bin/perl
#---------------------------------------------------------------------
# Copyright 2011 Christopher J. Madsen
#
# Test Dist::Zilla plugin for Pod::Loom
#---------------------------------------------------------------------

use strict;
use warnings;
use 5.008;
use utf8;

use Test::More 0.88;  # want done_testing

use Test::DZil qw(Builder);
use Encode qw(decode);

# Load Test::Differences, if available (better output for failures):
BEGIN {
  # SUGGEST PREREQ: Test::Differences
  if (eval "use Test::Differences; 1") {
    # Not all versions of Test::Differences support changing the style:
    eval { Test::Differences::unified_diff() }
  } else {
    eval '*eq_or_diff = \&is;'; # Just use "is" instead
  }
} # end BEGIN

#=====================================================================
my $generateResults;

if (@ARGV and $ARGV[0] eq 'gen') {
  # Just output the actual results, so they can be diffed against this file
  $generateResults = 1;
  open(OUT, '>:utf8', '/tmp/10-podloom.t') or die $!;
  printf OUT "#%s\nmy %%expected;\n", '=' x 69;
} else {
  plan tests => 3;
}

#=====================================================================
my %expected;

$expected{'module'} = <<'END EXPECTED MODULE';
package DZT::Sample;
# ABSTRACT: Sample DZ Dist

use strict;
use warnings;

our $VERSION = '0.04';

1;

__END__

=encoding utf8

=head1 NAME

DZT::Sample - Sample DZ Dist

=head1 VERSION

This is the version section.

=head1 SYNOPSIS

  use DZT::Sample;

=head1 DEPENDENCIES

DZT::Sample requires ümlauts.

=head1 AUTHOR

E. Xavier Ample  S<C<< <example AT example.org> >>>

=cut
END EXPECTED MODULE

$expected{'script'} = <<'END EXPECTED SCRIPT';
#! /usr/bin/perl



( run in 1.623 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )