diff options
author | dakkar <dakkar@thenautilus.net> | 2018-01-02 17:36:50 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2018-01-02 17:36:50 +0000 |
commit | 359821f1bc3d201abceb6d095c17d54dc5293045 (patch) | |
tree | b0ceaaae92e2b3ec275f7e1a8e76544254ed2d3a /t/tests/model | |
parent | better structure, and test, for License (diff) | |
download | Ultramarine-359821f1bc3d201abceb6d095c17d54dc5293045.tar.gz Ultramarine-359821f1bc3d201abceb6d095c17d54dc5293045.tar.bz2 Ultramarine-359821f1bc3d201abceb6d095c17d54dc5293045.zip |
make MusicFile work with non-absolute paths
Diffstat (limited to 't/tests/model')
-rw-r--r-- | t/tests/model/music-file.t | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/t/tests/model/music-file.t b/t/tests/model/music-file.t index 2016f8e..845a88d 100644 --- a/t/tests/model/music-file.t +++ b/t/tests/model/music-file.t @@ -5,28 +5,17 @@ use Ultramarine::Model::MusicFile; # test file generated with: # avconv -ac 2 -ar 44100 -f s16le -i /dev/zero -t 1 -q 0 -metadata title="some title" -metadata artist="some artist" test.mp3 -my Ultramarine::Model::MusicFile $mf .= new(:path('t/data/test.mp3')); -my $data = $mf.metadata; +# this way we test that MusicFile passes a usable path to avprobe, not +# just the .Str +my $path = IO::Path.new('test.mp3',:CWD('t/data/')); +my Ultramarine::Model::MusicFile $mf .= new(:$path); +my %data = $mf.metadata; -is-deeply( - $data, - %( - :bit_rate("33633.000000"), - :duration("1.044898"), - :filename("t/data/test.mp3"), - :format_long_name("MP2/3 (MPEG audio layer 2/3)"), - :format_name("mp3"), - :nb_streams(1), - :size("4393.000000"), - :start_time("0.000000"), - :tags(%( - :artist("some artist"), - :encoder("Lavf56.1.0"), - :title("some title"), - )), - ), - 'metadata should match', -); +is-approx(%data<bit_rate>.Num,33633,:1abs-tol,'bit rate should match'); +is-approx(%data<duration>.Num,1,:1abs-tol,'length should match'); +is(%data<format_name>,'mp3','format should match'); +is(%data<tags><artist>,'some artist','artist should match'); +is(%data<tags><title>,'some title','title should match'); done-testing; |