File: 03-path.t

package info (click to toggle)
libdancer-session-cookie-perl 0.30-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 276 kB
  • sloc: perl: 757; xml: 213; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 605 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
26
27
28
29
30
31
32
33
#!/usr/bin/perl

use strict;
use warnings;

use Test::More import => ['!pass'];

use Dancer;

my $CLASS = 'Dancer::Session::Cookie';
use_ok $CLASS;

note "test setup"; {
    set session_cookie_key => "The dolphins are in the jacuzzi";
}


note "default path"; {
    my $session = Dancer::Session::Cookie->create;
    my %cookie = $session->_cookie_params;
    is $cookie{path}, "/";
}


note "set the path"; {
    set session_cookie_path => "/some/thing";

    my $session = Dancer::Session::Cookie->create;
    my %cookie = $session->_cookie_params;
    is $cookie{path}, "/some/thing";
}

done_testing;