[Jifty-commit] r1592 - jifty/branches/moose/t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Jul 17 00:57:27 EDT 2006
Author: audreyt
Date: Mon Jul 17 00:57:27 2006
New Revision: 1592
Added:
jifty/branches/moose/t/09-menu.t
Log:
* basic menu test.
Added: jifty/branches/moose/t/09-menu.t
==============================================================================
--- (empty file)
+++ jifty/branches/moose/t/09-menu.t Mon Jul 17 00:57:27 2006
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More qw(no_plan);
+
+use_ok('Jifty');
+use_ok('Jifty::Web::Menu');
+
+my $output;
+$ENV{REQUEST_URI} = '';
+no warnings qw( redefine once );
+*Jifty::Web::out = sub { $output .= $_[1] };
+*Jifty::Web::request = sub { bless {}, 'FakeRequest' };
+*FakeRequest::path = sub { '/' };
+*FakeRequest::continuation = sub { undef };
+*_ = sub { $_[0] };
+
+my $top = Jifty::Web::Menu->new;
+$top->child('Home' => url => "/", sort_order => 0);
+$top->child('Item1' => url => "/1/", sort_order => 1);
+$top->child('Item2' => url => "/2/", sort_order => 2);
+
+$top->render_as_menu;
+like($output, qr{ "/" .* Home .* "/1/" .* Item1 .* "/2/" .* Item2 }sx, "menu rendered");
More information about the Jifty-commit
mailing list