File: 00_basic.t

package info (click to toggle)
libmastodon-client-perl 0.017-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 336 kB
  • sloc: perl: 1,525; makefile: 9
file content (30 lines) | stat: -rw-r--r-- 671 bytes parent folder | download
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
26
27
28
29
30
use Test2::V0;

use Mastodon::Client;

my $client = Mastodon::Client->new(
    instance      => 'mastodon.cloud',
    name          => 'JJ',
    client_id     => 'id',
    client_secret => 'secret',
    access_token  => 'token',
    scopes        => [qw( read write )],
);

isa_ok( $client, 'Mastodon::Client' );

is $client->name, 'JJ', 'Correct name';

is $client->scopes, [qw( read write )], 'Correct scopes';

$client = Mastodon::Client->new;

is $client->name, undef, 'Name has no default';

is $client->scopes, ['read'],
  'Scopes default to read only';

like $client->instance->uri, qr/mastodon\.social/,
  'Instance defaults to mastodon.social';

done_testing();