Support testing against two apps in same perl interpreter
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / two_app.t
diff --git a/t/two_app.t b/t/two_app.t
new file mode 100644 (file)
index 0000000..a54529b
--- /dev/null
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+
+use Test::More;
+use lib 't/lib';
+
+eval {
+    require Catalyst::Plugin::Session;
+    require Catalyst::Plugin::Session::State::Cookie;
+};
+
+if ($@) {
+    diag($@);
+    plan skip_all => "Need Catalyst::Plugin::Session to run this test";
+} else {
+    plan tests => 4;
+}
+
+use Test::WWW::Mechanize::Catalyst;
+
+my $m1 = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'Catty');
+my $m2 = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'CattySession');
+
+$m1->get_ok("/name");
+$m1->title_is('Catty');
+
+$m2->get_ok("/name");
+$m2->title_is('CattySession');