File: 007_match_exact_urls.t

package info (click to toggle)
libpath-router-perl 0.15-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 276 kB
  • sloc: perl: 1,863; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 749 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
#!/usr/bin/perl

use strict;
use warnings;

use Test::More 1.001013;

use Path::Router;

my $r = Path::Router->new;
isa_ok($r, 'Path::Router');

$r->add_route('/math/simple/add', target => (bless {} => 'Math::Simple::add'));
$r->add_route('/math/simple/sub', target => (bless {} => 'Math::Simple::sub'));
$r->add_route('/math/simple/mul', target => (bless {} => 'Math::Simple::mul'));
$r->add_route('/math/simple/div', target => (bless {} => 'Math::Simple::div'));

isa_ok($r->match('math/simple/add')->target, 'Math::Simple::add');
isa_ok($r->match('math/simple/sub')->target, 'Math::Simple::sub');
isa_ok($r->match('math/simple/mul')->target, 'Math::Simple::mul');
isa_ok($r->match('math/simple/div')->target, 'Math::Simple::div');

done_testing;