Code, test, docs.
[catagits/Catalyst-Plugin-Session.git] / t / live_accessor.t
1 #!/usr/bin/perl
2 #
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8 BEGIN {
9     eval { require Catalyst::Plugin::Session::State::Cookie; Catalyst::Plugin::Session::State::Cookie->VERSION(0.03) }
10       or plan skip_all =>
11       "Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test";
12
13     eval {
14         require Test::WWW::Mechanize::Catalyst;
15         Test::WWW::Mechanize::Catalyst->VERSION(0.51);
16     }
17     or plan skip_all =>
18         'Test::WWW::Mechanize::Catalyst >= 0.51 is required for this test';
19
20     plan tests => 4;
21 }
22
23 use lib "t/lib";
24 use Test::WWW::Mechanize::Catalyst "SessionTestApp";
25
26 my $ua = Test::WWW::Mechanize::Catalyst->new;
27
28 $ua->get_ok("http://localhost/accessor_test", "Set session vars okay");
29
30 $ua->content_contains("two: 2", "k/v list setter works okay");
31
32 $ua->content_contains("four: 4", "hashref setter works okay");
33
34 $ua->content_contains("five: 5", "direct access works okay");
35