SPECS: perl-Test-use-ok.spec - pl

qboosh qboosh at pld-linux.org
Sat Apr 15 19:34:27 CEST 2006


Author: qboosh                       Date: Sat Apr 15 17:34:27 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- pl

---- Files affected:
SPECS:
   perl-Test-use-ok.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SPECS/perl-Test-use-ok.spec
diff -u SPECS/perl-Test-use-ok.spec:1.1 SPECS/perl-Test-use-ok.spec:1.2
--- SPECS/perl-Test-use-ok.spec:1.1	Sat Apr  8 14:49:51 2006
+++ SPECS/perl-Test-use-ok.spec	Sat Apr 15 19:34:22 2006
@@ -7,7 +7,7 @@
 %define	pdir	Test
 %define	pnam	use-ok
 Summary:	Test::use::ok - Alternative to Test::More::use_ok
-#Summary(pl):	
+Summary(pl):	Test::use::ok - alternatywa dla Test::More::use_ok
 Name:		perl-Test-use-ok
 Version:	0.01
 Release:	1
@@ -44,8 +44,28 @@
 and they will be executed at BEGIN time. The explicit space after use
 makes it clear that this is a single compile-time action.
 
-# %description -l pl
-# TODO
+%description -l pl
+Zgodnie z dokumentacją Test::More, zaleca się wywoływanie use_ok()
+wewnątrz bloku BEGIN, aby funkcje były eksportowane w czasie
+kompilacji, a prototypy odpowiednio honorowane.
+
+Czyli zamiast pisania tak:
+
+    use_ok( 'Jakis::Modul' );
+    use_ok( 'Inny::Modul' );
+
+Powinno pisać się tak:
+
+    BEGIN { use_ok( 'Jakis::Modul' ); }
+    BEGIN { use_ok( 'Inny::Modul' ); }
+
+Jednak ludzie często zapominają dodać BEGIN lub błędnie grupują use_ok
+z innymi testami w pojedynczym bloku BEGIN, co może powodować subtelne
+różnice w kolejności wykonywania.
+
+Przy użyciu tego modułu wystarczy zmienić wszystkie use_ok w skryptach
+testowych na use ok, i zostaną one wykonane w czasie BEGIN. Spacja po
+use daje jasność, że jest to pojedyncza akcja w czasie kompilacji.
 
 %prep
 %setup -q -n %{pdir}-%{pnam}-%{version}
@@ -78,6 +98,8 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2006/04/15 17:34:22  qboosh
+- pl
+
 Revision 1.1  2006/04/08 12:49:51  migo
 - initial revision
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/perl-Test-use-ok.spec?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list