File: update.t

package info (click to toggle)
libtwitter-api-perl 1.0006-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 424 kB
  • sloc: perl: 2,868; makefile: 7
file content (35 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (2)
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
31
32
33
34
35
#!perl
use 5.14.1;
use warnings;
use Test::Spec;

use Twitter::API;

describe update => sub {
    my $client;
    before each => sub {
        $client = Twitter::API->new_with_traits(
            traits              => 'ApiMethods',
            consumer_key        => 'key',
            consumer_secret     => 'secret',
            access_token        => 'token',
            access_token_secret => 'token-secret',
        );
        $client->stubs(send_request => sub { return });
    };

    it 'flattens media_ids' => sub {
        my $req;

        my $context = $client->update('hello world', {
            media_ids => [ 1..3 ],
        });

        is_deeply $context->args, {
            status    => 'hello world',
            media_ids => '1,2,3',
        };
    };
};

runtests;