aboutsummaryrefslogtreecommitdiff
path: root/t/40-response.t
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@gmail.com>2018-08-04 18:52:16 -0300
committerMatias Linares <matiaslina@gmail.com>2018-08-04 18:52:16 -0300
commitf3f383db83504fd6e921b7899bbe893575625d45 (patch)
tree51ba10f1ff046c8ed0370395d872767136418cbc /t/40-response.t
parent305bb42b3311c8ac9d04235e5548ae9b67de06ac (diff)
downloadperl6-matrix-client-f3f383db83504fd6e921b7899bbe893575625d45.tar.gz
Add tests
Diffstat (limited to 't/40-response.t')
-rw-r--r--t/40-response.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/40-response.t b/t/40-response.t
new file mode 100644
index 0000000..61dd635
--- /dev/null
+++ b/t/40-response.t
@@ -0,0 +1,25 @@
+use lib 'lib';
+use Test;
+use JSON::Tiny;
+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;