]>
Commit | Line | Data |
---|---|---|
27da1d36 MG |
1 | #!/usr/bin/perl |
2 | use strict; | |
3 | use warnings; | |
4 | ||
5 | use Test::More tests => 14; | |
6 | BEGIN { use_ok('WebService::Strike::Torrent') } | |
7 | ||
8 | my %data = ( | |
9 | leeches => 13, | |
10 | size => '587 MB', | |
11 | torrent_hash => 'b425907e5755031bda4a8d1b6dccaca97da14c04', | |
12 | file_count => 1, | |
13 | sub_category => '', | |
14 | torrent_category => 'Applications', | |
15 | file_info => [{ | |
16 | file_names => [ 'archlinux-2015.01.01-dual.iso' ], | |
17 | file_lengths => [ 615514112 ], | |
18 | }], | |
19 | upload_date => 'Jan 6, 2015', | |
20 | seeds => 645, | |
21 | uploader_username => 'The_Doctor-', | |
22 | torrent_title => 'Arch Linux 2015.01.01 (x86/x64)' | |
23 | ); | |
24 | ||
25 | my $t = WebService::Strike::Torrent->new(\%data); | |
26 | ||
27 | is $t->hash, 'B425907E5755031BDA4A8D1B6DCCACA97DA14C04', 'hash'; | |
28 | is $t->title, 'Arch Linux 2015.01.01 (x86/x64)', 'title'; | |
29 | is $t->category, 'Applications', 'category'; | |
30 | is $t->sub_category, '', 'sub_category'; | |
31 | is $t->seeds, 645, 'seeds'; | |
32 | is $t->leeches, 13, 'leeches'; | |
33 | is $t->count, 1, 'count'; | |
34 | is $t->size, '587 MB', 'size'; | |
35 | is $t->date, 1420495200,'date'; | |
36 | is $t->uploader, 'The_Doctor-', 'uploader'; | |
37 | is $t->names->[0], 'archlinux-2015.01.01-dual.iso', 'names'; | |
38 | is $t->lengths->[0], 615514112, 'lengths'; | |
39 | is $t->magnet, 'magnet:?xt=urn:btih:B425907E5755031BDA4A8D1B6DCCACA97DA14C04&dn=Arch%20Linux%202015.01.01%20%28x86%2Fx64%29', 'magnet'; |