File: 02_fails.t

package info (click to toggle)
libnet-twitter-perl 3.13008-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 656 kB
  • ctags: 235
  • sloc: perl: 5,408; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 647 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
#!perl
use warnings;
use strict;
use Test::More;
use Test::Exception;
use lib qw(t/lib);
use Net::Twitter;

eval 'use TestUA';
plan skip_all => 'LWP::UserAgent 5.819 required for tests' if $@;

plan tests => 2;

my $nt = Net::Twitter->new(
    traits   => [qw/API::REST/],
    username => 'just_me',
    password => 'secret',
);

my $t = TestUA->new($nt->ua);

# things that should fail
throws_ok { $nt->relationship_exists(qw/one two three/) } qr/expected 2 args/, 'too many args';
throws_ok {
    Net::Twitter->new(useragent_class => 'NoSuchModule::Test7701')->verify_credentials
} qr/Can't locate NoSuchModule/, 'bad useragent_class';

exit 0;