[Jifty-commit] r5512 - in jifty/trunk: t/TestApp-Plugin-PasswordAuth/t

Jifty commits jifty-commit at lists.jifty.org
Mon Jun 16 08:48:37 EDT 2008


Author: ishigaki
Date: Mon Jun 16 08:48:37 2008
New Revision: 5512

Modified:
   jifty/trunk/lib/Jifty/I18N.pm
   jifty/trunk/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t

Log:
Jifty::I18N: as Plugin::PasswordAuth's test was broken for me due to the I18N, extended get_language_handle to accept a lang name explicitly, and let the test use English handle without loading session

Modified: jifty/trunk/lib/Jifty/I18N.pm
==============================================================================
--- jifty/trunk/lib/Jifty/I18N.pm	(original)
+++ jifty/trunk/lib/Jifty/I18N.pm	Mon Jun 16 08:48:37 2008
@@ -169,7 +169,9 @@
 sub get_language_handle {
     # XXX: subrequest should not need to get_handle again.
     my $self = shift;
-    my $lang = Jifty->web->session->get('jifty_lang');
+    # optional argument makes it easy to disable I18N
+    # while comparing test strings (without loading session)
+    my $lang = shift || Jifty->web->session->get('jifty_lang');
     $$DynamicLH = $self->get_handle($lang ? $lang : ()) if $DynamicLH;
 }
 

Modified: jifty/trunk/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t	(original)
+++ jifty/trunk/t/TestApp-Plugin-PasswordAuth/t/00-model-User.t	Mon Jun 16 08:48:37 2008
@@ -13,6 +13,9 @@
 
 use Jifty::Test tests => 24;
 
+# force to use English handle to compare strings successfully
+Jifty::I18N->get_language_handle('en');
+
 # Make sure we can load the model
 use_ok('TestApp::Plugin::PasswordAuth::Model::User');
 


More information about the Jifty-commit mailing list