/
30-examples-reuse-mixed-app.t
46 lines (35 loc) · 1.25 KB
/
30-examples-reuse-mixed-app.t
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
34
35
36
37
38
39
40
41
42
43
44
45
46
use v6.c;
use Test;
use Bailador::Test;
plan 4;
chdir 'examples/reuse';
%*ENV<P6W_CONTAINER> = 'Bailador::Test';
%*ENV<BAILADOR_APP_ROOT> = $*CWD.absolute;
my $app = EVALFILE "bin/mixed_app.pl6";
subtest {
plan 2;
my %data = run-psgi-request($app, 'GET', '/');
is-deeply %data<response>, [200, ["Content-Type" => "text/html"], q{<h1>Welcome to the root of MixedApp</h1>}], 'route GET /';
is %data<err>, '';
}, '/';
subtest {
plan 2;
my %data = run-psgi-request($app, 'GET', '/mixedapp');
is-deeply %data<response>, [200, ["Content-Type" => "text/html"], q{Route /mixedapp}], 'route GET /';
is %data<err>, '';
}, '/';
todo "Implement reusing applications";
subtest {
plan 2;
my %data = run-psgi-request($app, 'GET', '/reuse');
is-deeply %data<response>, [200, ["Content-Type" => "text/html"], q{<h1>Welcome to root of the Shared App</h1>}], 'route GET /';
is %data<err>, '';
}, '/';
todo "Implement reusing applications";
subtest {
plan 2;
my %data = run-psgi-request($app, 'GET', '/reuse/sharedapp');
is-deeply %data<response>, [200, ["Content-Type" => "text/html"], q{Route /sharedapp of Shared App}], 'route GET /';
is %data<err>, '';
}, '/';
chdir '../..';