]>
Commit | Line | Data |
---|---|---|
e3a2ade0 ER |
1 | %define status beta |
2 | %define pearname Testing_DocTest | |
876dfa20 | 3 | %include /usr/lib/rpm/macros.php |
e3a2ade0 ER |
4 | Summary: %{pearname} - A Unit Test framework for writing tests in your php code docstrings |
5 | Summary(pl.UTF-8): %{pearname} - framework do pisania testów w kodzie php za pomocą docstrings | |
6 | Name: php-pear-%{pearname} | |
7 | Version: 0.6.0 | |
8 | Release: 1 | |
876dfa20 AG |
9 | License: MIT |
10 | Group: Development/Languages/PHP | |
e3a2ade0 ER |
11 | Source0: http://pear.php.net/get/%{pearname}-%{version}.tgz |
12 | # Source0-md5: b6143bc74c19f29368f72957db608c42 | |
876dfa20 | 13 | URL: http://pear.php.net/package/Testing_DocTest/ |
a61ed21b | 14 | BuildRequires: php-pear-PEAR >= 1:1.4.0 |
876dfa20 | 15 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
feb50010 | 16 | BuildRequires: rpmbuild(macros) >= 1.300 |
db2eaee9 | 17 | Requires: php(tokenizer) |
876dfa20 | 18 | Requires: php-pear |
a61ed21b | 19 | Requires: php-pear-Console_CommandLine >= 1.0.0-0.RC3 |
9ed630f2 | 20 | Requires: php-pear-PEAR-core >= 1:1.4.0 |
ddc1a2a0 | 21 | Obsoletes: php-pear-Testing_DocTest-tests |
876dfa20 AG |
22 | BuildArch: noarch |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %description | |
26 | Testing_DocTest allows the developer to write unit tests directly in | |
27 | the <code></code> blocs of your functions, classes and class methods | |
28 | doc comments. | |
29 | ||
30 | It comes with a default runner (phpdt) that will parse all your | |
31 | <code></code> blocs and will run the extracted tests. Running tests is | |
32 | as simple as: | |
33 | ||
34 | $ phpdt /path/to/your/code | |
35 | ||
36 | There are several advantages in using Testing_DocTest: | |
37 | - it makes unit tests writing funnier, easier and quicker (there's no | |
38 | infrastructure to setup, you just install the package, write your code | |
39 | examples tests and you're done !); | |
40 | - it ensures that doc comments are up-to-date by verifying that all | |
41 | examples work as documented; | |
42 | - it enforces writing of tutorial documentation, liberally illustrated | |
43 | with input-output examples. | |
44 | ||
e3a2ade0 | 45 | In PEAR status of this package is: %{status}. |
876dfa20 AG |
46 | |
47 | %description -l pl.UTF-8 | |
48 | Testing_DocTest pozwala developerowi na pisanie testów bezpośrednio | |
49 | wewnątrz znaczników <code></code> w komentarzach funkcji, klas i ich | |
50 | metod. | |
51 | ||
52 | Dostarczany jest program (phpdt) który przetworzy bloki <code></code> | |
53 | i wykona pobrane testy. Wywołanie jest proste: | |
54 | ||
55 | $ phpdt /sciezka/do/kodu | |
56 | ||
57 | Istnieje sporo korzyści z wykorzystania Testing_DocTest: | |
58 | - sprawia, że pisanie testów jest prostsze i szybsze (brak | |
59 | infrastruktury do konfiguracji, wystarczy zainstalowanie pakietu i | |
60 | napisanie testu), | |
61 | - zapewnia aktualność komentarzy poprzez weryfikację załączonych | |
62 | przykładów, | |
63 | - wymusza pisanie dokumentacji, ilustrując za pomocą przykładów | |
64 | wejścia-wyjścia. | |
65 | ||
e3a2ade0 | 66 | Ta klasa ma w PEAR status: %{status}. |
876dfa20 | 67 | |
876dfa20 AG |
68 | %prep |
69 | %pear_package_setup | |
70 | ||
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | install -d $RPM_BUILD_ROOT{%{php_pear_dir},%{_bindir}} | |
74 | %pear_package_install | |
75 | install usr/bin/phpdt $RPM_BUILD_ROOT%{_bindir} | |
76 | ||
77 | %clean | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %files | |
81 | %defattr(644,root,root,755) | |
82 | %doc install.log | |
83 | %attr(755,root,root) %{_bindir}/phpdt | |
84 | %{php_pear_dir}/.registry/*.reg | |
85 | %{php_pear_dir}/Testing/DocTest | |
86 | %{php_pear_dir}/Testing/DocTest.php |