Files
perl-Test-TableDriven/perl-Test-TableDriven.spec

61 lines
1.9 KiB
RPMSpec

# vim: set sw=4 ts=4 et nu:
Name: perl-Test-TableDriven
Version: 0.02
Release: 0
Summary: Write tests, not scripts that run them
Source: http://search.cpan.org/CPAN/authors/id/J/JR/JROCKWAY/Test-TableDriven-%{version}.tar.gz
URL: http://search.cpan.org/dist/Test-TableDriven
Group: Development/Libraries/Perl
License: GNU General Public License version 2 or later or Artistic (GPLv2+ or Artistic)
BuildRoot: %{_tmppath}/build-%{name}-%{version}
%{perl_requires}
BuildRequires: perl-macros
BuildRequires: make
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Test::More)
BuildRequires: perl(Data::Dumper)
Requires: perl(Test::More)
Requires: perl(Data::Dumper)
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description
Writing table-driven tests is usually a good idea. Adding a test case
doesn't require adding code, so it's easy to avoid messing up the other
tests. However, actually going from a table of tests to a test that runs
is non-trivial.
"Test::TableDriven" makes writing the test drivers trivial. You simply
define your test cases and write a function that turns the input data into
output data to compare against. "Test::TableDriven" will compute how many
tests need to be run, and then run the tests.
Concentrate on your data and what you're testing, not "plan tests ="
scalar keys %%test_cases> and a big foreach loop.
%prep
%setup -q -n "Test-TableDriven-%{version}"
%__sed -i '/^auto_install/d' Makefile.PL
%build
%__perl Makefile.PL PREFIX="%{_prefix}"
%__make %{?jobs:-j%{jobs}}
%install
%perl_make_install
%perl_process_packlist
%check
%__make test
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files
%defattr(-,root,root)
%doc Changes README
%dir %{perl_vendorlib}/Test
%{perl_vendorlib}/Test/TableDriven.pm
%doc %{perl_man3dir}/Test::TableDriven.%{perl_man3ext}%{ext_man}