File: no-stubs.t

package info (click to toggle)
libnumber-phone-perl 3.6006-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 136,072 kB
  • sloc: perl: 2,719; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 516 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -w

use strict;

use lib 't/inc';
use fatalwarnings;

use lib 't/lib';

use Number::Phone qw(nostubs);

use Test::More;

END { done_testing(); }

use Number::Phone::Country qw(noexport);

is(Number::Phone->new("+442087712924")->country_code(), 44, "known countries return objects");

# let's break the UK
$Number::Phone::Country::idd_codes{'44'} = 'MOCK';
$Number::Phone::Country::prefix_codes{'MOCK'} = ['44',   '00',  undef];

eval { Number::Phone->new('+442087712924') };
ok($@, "nostubs works");