Burak Gürsoy avatar Burak Gürsoy committed 6c105f4

Fix tests & pod

Comments (0)

Files changed (10)

lib/MP3/M3U/Parser/Constants.pm

 
 =pod
 
+=encoding utf8
+
 =head1 NAME
 
 MP3::M3U::Parser::Constants - Constants for MP3::M3U::Parser

lib/MP3/M3U/Parser/Dummy.pm

 
 =pod
 
+=encoding utf8
+
 =head1 NAME
 
 MP3::M3U::Parser::Dummy - Template container class

lib/MP3/M3U/Parser/Export.pm

 
 =pod
 
+=encoding utf8
+
 =head1 NAME
 
 MP3::M3U::Parser::Export - Exports playlist to HTML/XML
 use warnings;
 use Test::More qw(no_plan);
 use File::Spec;
+use MP3::M3U::Parser;
 
-BEGIN {
-    use_ok('MP3::M3U::Parser');
-}
+my $file = '03_basic.html';
+
+unlink $file if -e $file;
 
 my $parser = MP3::M3U::Parser->new(
                 -parse_path => 'asis',
 my $result = $parser->result;
 is(ref $result, 'ARRAY', 'Parser');
 
-is($parser, $parser->export(-file => '03_basic.html'), 'Parser');
+is($parser, $parser->export(-file => $file), 'Parser');
 my %info = $parser->info;
 is(ref $info{drive}, 'ARRAY', 'Parser');
 is($parser, $parser->reset, 'Parser');
 use warnings;
 use Test::More qw(no_plan);
 use File::Spec;
+use MP3::M3U::Parser;
 
-BEGIN {
-    use_ok('MP3::M3U::Parser');
-}
+my $file = '04_basic_xml.xml';
+
+unlink $file if -e $file;
 
 my $parser = MP3::M3U::Parser->new(
                 -parse_path => 'asis',
 my $result = $parser->result;
 is(ref $result, 'ARRAY', 'Parser');
 
-is( $parser, $parser->export(-file => '04_basic_xml.xml'), 'Parser');
+is( $parser, $parser->export(-file => $file), 'Parser');
 
 my %info = $parser->info;
 is( ref $info{drive}, 'ARRAY', 'Parser' );
 use warnings;
 use Test::More qw(no_plan);
 use File::Spec;
+use MP3::M3U::Parser;
 
-BEGIN {
-    use_ok('MP3::M3U::Parser');
-}
+my $file = '04_basic_xml.xml';
+
+unlink $file if -e $file;
 
 my $parser = MP3::M3U::Parser->new(
                 -parse_path => 'asis',
 my $result = $parser->result;
 is(ref $result, 'ARRAY', 'Parser');
 
-is( $parser, $parser->export(-file => '04_basic_xml.xml'), 'Parser');
+is( $parser, $parser->export(-file => $file ), 'Parser');
 
 my %info = $parser->info;
 is( ref $info{drive}, 'ARRAY', 'Parser' );
 use File::Spec;
 use Test::More qw( no_plan );
 
-BEGIN {
-    use_ok('MP3::M3U::Parser');
-}
+use MP3::M3U::Parser;
+
+my $file = '05_sub_html.html';
+
+unlink $file if -e $file;
 
 my $parser = MyParser->new;
 $parser->parse(
 );
 $parser->export(
     -format    => 'html',
-    -file      => '05_sub_html.html',
+    -file      => $file,
     -overwrite => 1,
 );
 

t/06-sub_search.t

 use Test::More qw( no_plan );
 use File::Spec;
 
-BEGIN {
-    use_ok('MP3::M3U::Parser');
-}
+use MP3::M3U::Parser;
+
+my $file = '06_sub_search.html';
+
+unlink $file if -e $file;
 
 my $parser = MyParser->new(
                 -search => 'fred mer'
 
 $parser->export(
     -format    => 'html',
-    -file      => '06_sub_search.html',
+    -file      => $file,
     -overwrite => 1,
 );
 

t/07-scalar_xml.t

 use Test::More qw( no_plan );
 use File::Spec;
 
-BEGIN {
-    use_ok('MP3::M3U::Parser');
-}
+use MP3::M3U::Parser;
+
+my $file = '07_scalar_xml.xml';
+
+unlink $file if -e $file;
 
 my $output = q{};
 my $parser = MP3::M3U::Parser->new(
 );
 
 my $fh = IO::File->new;
-$fh->open( '07_scalar_xml.xml', '>' ) or croak "I can not open file: $!";
+$fh->open( $file, '>' ) or croak "I can not open file: $!";
 print {$fh} $output or croak "I can't print to FH: $!";
 $fh->close;
 

t/08-scalar_html.t

 use Test::More qw( no_plan );
 use File::Spec;
 
-BEGIN {
-    use_ok('MP3::M3U::Parser');
-}
+use MP3::M3U::Parser;
+
+my $file = '08_scalar_html.html';
+
+unlink $file if -e $file;
 
 my $output = q{};
 my $parser = MP3::M3U::Parser->new(
 );
 
 my $fh = IO::File->new;
-$fh->open( '08_scalar_html.html', '>' ) or croak "I can not open file: $!";
+$fh->open( $file, '>' ) or croak "I can not open file: $!";
 print {$fh} $output or croak "Can't print to FH: $!";
 $fh->close;
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.