AtomicParsley-Command
view release on metacpan or search on metacpan
t/10_command.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::Fatal;
use Test::More;
use FindBin qw($Bin);
use File::Copy;
use IPC::Cmd '0.76', ();
use AtomicParsley::Command::Tags;
if( IPC::Cmd::can_run('AtomicParsley') ){
plan tests => 22;
} else {
plan skip_all => 'AtomicParsley not present';
}
require_ok('AtomicParsley::Command');
my $ap;
my $tags;
my $testfile = "$Bin/resources/Family.mp4";
$ap = new_ok('AtomicParsley::Command');
like( $ap->{ap}, qr/AtomicParsley$/ );
is( $ap->{verbose}, 0 );
# _parse_tags
my $output = 'Atom "©nam" contains: Family (Mock the Week)
Atom "©ART" contains: Milton Jones
Atom "aART" contains: Milton Jones
Atom "gnre" contains: Comedy
Atom "tvsh" contains: Milton Jones
Atom "desc" contains: foo bar
baz
';
$tags = $ap->_parse_tags($output);
is( $tags->{title}, 'Family (Mock the Week)', 'title' );
is( $tags->{genre}, 'Comedy', 'genre' );
my $desc = 'foo bar
baz';
is( $tags->{description}, $desc, 'description' );
# write_tags
my $write_tags = AtomicParsley::Command::Tags->new(
artist => 'test_artist',
title => 'test_title',
album => 'test_album',
genre => 'test_genre',
tracknum => '1/10',
disk => '1/2',
comment => 'test_comment',
year => '2011',
lyrics => 'test_lytics',
composer => 'test_composer',
copyright => 'test_copyright',
grouping => 'test_grouping',
#artwork => 'test_
bpm => '12',
albumArtist => 'test_albumArtist',
( run in 0.949 second using v1.01-cache-2.11-cpan-54e63673c56 )