]> git.pld-linux.org Git - packages/perl-Test-WWW-Mechanize-PSGI.git/blob - perl-Test-WWW-Mechanize-PSGI.spec
- initial
[packages/perl-Test-WWW-Mechanize-PSGI.git] / perl-Test-WWW-Mechanize-PSGI.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # do not perform "make test"
4 #
5 %define         pdir    Test
6 %define         pnam    WWW-Mechanize-PSGI
7 Summary:        Test::WWW::Mechanize::PSGI - Test PSGI programs using WWW::Mechanize
8 Name:           perl-Test-WWW-Mechanize-PSGI
9 Version:        0.39
10 Release:        1
11 # same as perl
12 License:        GPL v1+ or Artistic
13 Group:          Development/Languages/Perl
14 Source0:        http://www.cpan.org/modules/by-module/Test/%{pdir}-%{pnam}-%{version}.tar.gz
15 # Source0-md5:  75fde422172f4a098ac14d39fa06ee57
16 URL:            https://metacpan.org/release/Test-WWW-Mechanize-PSGI
17 BuildRequires:  perl-devel >= 1:5.8.0
18 BuildRequires:  rpm-perlprov >= 4.1-13
19 BuildRequires:  rpmbuild(macros) >= 1.745
20 %if %{with tests}
21 BuildRequires:  perl-Plack
22 BuildRequires:  perl-Test-WWW-Mechanize
23 BuildRequires:  perl-Try-Tiny
24 %endif
25 BuildArch:      noarch
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 PSGI is a specification to decouple web server environments from web
30 application framework code. Test::WWW::Mechanize is a subclass of
31 WWW::Mechanize that incorporates features for web application testing.
32 The Test::WWW::Mechanize::PSGI module meshes the two to allow easy
33 testing of PSGI applications.
34
35 Testing web applications has always been a bit tricky, normally
36 requiring starting a web server for your application and making real
37 HTTP requests to it. This module allows you to test PSGI web
38 applications but does not require a server or issue HTTP requests.
39 Instead, it passes the HTTP request object directly to PSGI. Thus you
40 do not need to use a real hostname: "http://localhost/" will do.
41 However, this is optional. The following two lines of code do exactly
42 the same thing:
43
44 $mech->get_ok('/action'); $mech->get_ok('http://localhost/action');
45
46 This makes testing fast and easy. Test::WWW::Mechanize provides
47 functions for common web testing scenarios. For example:
48
49 $mech->get_ok( $page ); $mech->title_is( "Invoice Status", "Make sure
50 we're on the invoice page" ); $mech->content_contains( "Andy Lester",
51 "My name somewhere" ); $mech->content_like( qr/(cpan|perl)\.org/,
52 "Link to perl.org or CPAN" );
53
54 %prep
55 %setup -q -n %{pdir}-%{pnam}-%{version}
56
57 %build
58 %{__perl} Makefile.PL \
59         INSTALLDIRS=vendor
60 %{__make}
61
62 %{?with_tests:%{__make} test}
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66
67 %{__make} pure_install \
68         DESTDIR=$RPM_BUILD_ROOT
69
70 %clean
71 rm -rf $RPM_BUILD_ROOT
72
73 %files
74 %defattr(644,root,root,755)
75 %doc Changes INSTALL
76 %{perl_vendorlib}/Test/WWW/Mechanize/*.pm
77 %{_mandir}/man3/*
This page took 0.093953 seconds and 4 git commands to generate.