3 %bcond_without tests # do not perform "make 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
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
21 BuildRequires: perl-Plack
22 BuildRequires: perl-Test-WWW-Mechanize
23 BuildRequires: perl-Try-Tiny
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
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
44 $mech->get_ok('/action'); $mech->get_ok('http://localhost/action');
46 This makes testing fast and easy. Test::WWW::Mechanize provides
47 functions for common web testing scenarios. For example:
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" );
55 %setup -q -n %{pdir}-%{pnam}-%{version}
58 %{__perl} Makefile.PL \
62 %{?with_tests:%{__make} test}
65 rm -rf $RPM_BUILD_ROOT
67 %{__make} pure_install \
68 DESTDIR=$RPM_BUILD_ROOT
71 rm -rf $RPM_BUILD_ROOT
74 %defattr(644,root,root,755)
76 %{perl_vendorlib}/Test/WWW/Mechanize/*.pm