aboutsummaryrefslogtreecommitdiff
path: root/t/40-response.t
blob: cc219b265775196b14ffeffcbb3c4176e03cef8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use lib 'lib';
use Test;
use JSON::Fast;
use Matrix::Response;
plan 7;

my $test-file = 'sync.json';

unless $test-file.IO.f {
    skip-rest 'Missing sync.json to test';
    exit;
}

my $data = from-json($test-file.IO.slurp);

ok $data;
lives-ok { Matrix::Response::Sync.new($test-file.IO.slurp) };
lives-ok { Matrix::Response::Sync.new($data) };

my $res = Matrix::Response::Sync.new($data);
can-ok $res, 'joined-rooms';
can-ok $res, 'presence';

isa-ok $res.joined-rooms, List;
isa-ok $res.presence, List;