summaryrefslogtreecommitdiff
path: root/php-pear-Testing_DocTest.spec
blob: 1d931e47f79164790530c289d118cf146ea7ec78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
%include	/usr/lib/rpm/macros.php
%define		_status		beta
%define		_pearname	Testing_DocTest
Summary:	%{_pearname} - A Unit Test framework for writing tests in your php code docstrings
Summary(pl.UTF-8):	%{_pearname} - framework do pisania testów w kodzie php za pomocą docstrings
Name:		php-pear-%{_pearname}
Version:	0.5.0
Release:	2
License:	MIT
Group:		Development/Languages/PHP
Source0:	http://pear.php.net/get/%{_pearname}-%{version}.tgz
# Source0-md5:	9eccb6d8339f01d2546a32d18e20f8ee
URL:		http://pear.php.net/package/Testing_DocTest/
BuildRequires:	php-pear-PEAR >= 1:1.4.0
BuildRequires:	rpm-php-pearprov >= 4.4.2-11
BuildRequires:	rpmbuild(macros) >= 1.300
Requires:	php-pear
Requires:	php-pear-Console_CommandLine >= 1.0.0-0.RC3
Requires:	php-pear-PEAR-core >= 1:1.4.0
Requires:	php-tokenizer
Obsoletes:	php-pear-Testing_DocTest-tests
BuildArch:	noarch
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
Testing_DocTest allows the developer to write unit tests directly in
the <code></code> blocs of your functions, classes and class methods
doc comments.

It comes with a default runner (phpdt) that will parse all your
<code></code> blocs and will run the extracted tests. Running tests is
as simple as:

$ phpdt /path/to/your/code

There are several advantages in using Testing_DocTest:
- it makes unit tests writing funnier, easier and quicker (there's no
  infrastructure to setup, you just install the package, write your code
  examples tests and you're done !);
- it ensures that doc comments are up-to-date by verifying that all
  examples work as documented;
- it enforces writing of tutorial documentation, liberally illustrated
  with input-output examples.

In PEAR status of this package is: %{_status}.

%description -l pl.UTF-8
Testing_DocTest pozwala developerowi na pisanie testów bezpośrednio
wewnątrz znaczników <code></code> w komentarzach funkcji, klas i ich
metod.

Dostarczany jest program (phpdt) który przetworzy bloki <code></code>
i wykona pobrane testy. Wywołanie jest proste:

$ phpdt /sciezka/do/kodu

Istnieje sporo korzyści z wykorzystania Testing_DocTest:
- sprawia, że pisanie testów jest prostsze i szybsze (brak
  infrastruktury do konfiguracji, wystarczy zainstalowanie pakietu i
  napisanie testu),
- zapewnia aktualność komentarzy poprzez weryfikację załączonych
  przykładów,
- wymusza pisanie dokumentacji, ilustrując za pomocą przykładów
  wejścia-wyjścia.

Ta klasa ma w PEAR status: %{_status}.

%prep
%pear_package_setup

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{php_pear_dir},%{_bindir}}
%pear_package_install
install usr/bin/phpdt $RPM_BUILD_ROOT%{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%doc install.log
%attr(755,root,root) %{_bindir}/phpdt
%{php_pear_dir}/.registry/*.reg
%{php_pear_dir}/Testing/DocTest
%{php_pear_dir}/Testing/DocTest.php