Skip to content

Commit

Permalink
remove inline tests from PPI::Toke::Pod
Browse files Browse the repository at this point in the history
  • Loading branch information
moregan authored and wchristian committed Jan 29, 2014
1 parent 6279fbb commit 324b993
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 49 deletions.
15 changes: 0 additions & 15 deletions lib/PPI/Token/Pod.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,6 @@ the content of all of them.
Returns a new C<PPI::Token::Pod> object, or C<undef> on error.
=begin testing merge after PPI::Node 4
# Create the test fragments
my $one = PPI::Token::Pod->new("=pod\n\nOne\n\n=cut\n");
my $two = PPI::Token::Pod->new("=pod\n\nTwo");
isa_ok( $one, 'PPI::Token::Pod' );
isa_ok( $two, 'PPI::Token::Pod' );
# Create the combined Pod
my $merged = PPI::Token::Pod->merge($one, $two);
isa_ok( $merged, 'PPI::Token::Pod' );
is( $merged->content, "=pod\n\nOne\n\nTwo\n\n=cut\n", 'Merged POD looks ok' );
=end testing
=cut

sub merge {
Expand Down
65 changes: 31 additions & 34 deletions t/ppi_token_pod.t
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
#!/usr/bin/perl

# Unit testing for PPI, generated by Test::Inline

use strict;
use File::Spec::Functions ':ALL';
BEGIN {
$| = 1;
$^W = 1;
no warnings 'once';
$PPI::XS_DISABLE = 1;
$PPI::Lexer::X_TOKENIZER ||= $ENV{X_TOKENIZER};
}
use PPI;

# Execute the tests
use Test::More tests => 4;

# =begin testing merge after PPI::Node 4
{
# Create the test fragments
my $one = PPI::Token::Pod->new("=pod\n\nOne\n\n=cut\n");
my $two = PPI::Token::Pod->new("=pod\n\nTwo");
isa_ok( $one, 'PPI::Token::Pod' );
isa_ok( $two, 'PPI::Token::Pod' );

# Create the combined Pod
my $merged = PPI::Token::Pod->merge($one, $two);
isa_ok( $merged, 'PPI::Token::Pod' );
is( $merged->content, "=pod\n\nOne\n\nTwo\n\n=cut\n", 'Merged POD looks ok' );
}


1;
#!/usr/bin/perl

use warnings;
use strict;
use File::Spec::Functions ':ALL';
BEGIN {
$| = 1;
$^W = 1;
no warnings 'once';
$PPI::XS_DISABLE = 1;
$PPI::Lexer::X_TOKENIZER ||= $ENV{X_TOKENIZER};
}
use PPI;

use Test::More tests => 4;

{
# Create the test fragments
my $one = PPI::Token::Pod->new("=pod\n\nOne\n\n=cut\n");
my $two = PPI::Token::Pod->new("=pod\n\nTwo");
isa_ok( $one, 'PPI::Token::Pod' );
isa_ok( $two, 'PPI::Token::Pod' );

# Create the combined Pod
my $merged = PPI::Token::Pod->merge($one, $two);
isa_ok( $merged, 'PPI::Token::Pod' );
is( $merged->content, "=pod\n\nOne\n\nTwo\n\n=cut\n", 'Merged POD looks ok' );
}


1;

0 comments on commit 324b993

Please sign in to comment.