File: aliases.t

package info (click to toggle)
libnet-twitter-perl 4.01043-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 844 kB
  • sloc: perl: 6,703; makefile: 13
file content (33 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (5)
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
#!perl
use warnings;
use strict;
use Net::Twitter;
use Test::More;
use Test::Warn;

my $nt = Net::Twitter->new(
    ssl  => 0,
    user => 'foo',
    pass => 'bar',
);

is $nt->username, 'foo', 'user alias';
is $nt->password, 'bar', 'pass alias';

{ # ensure it warns

    my @args = (
        ssl      => 0,
        username => 'foo',
        password => 'bar',
        user     => 'other',
        pass     => 'other-pass',
    );

    warnings_like { Net::Twitter->new(@args) } [
        qr/Both username and user provided/,
        qr/Both password and pass provided/,
    ], 'you have been warned';
}

done_testing;