Permalink
Browse files

Import of Test::Varnish 0.01

  • Loading branch information...
cosimo committed Jan 13, 2010
0 parents commit c861d7d302a6398e22d9d884d161d40cfd975299
Showing with 736 additions and 0 deletions.
  1. +5 −0 Changes
  2. +11 −0 MANIFEST
  3. +22 −0 Makefile.PL
  4. +52 −0 README
  5. +40 −0 examples/live-sites
  6. +463 −0 lib/Test/Varnish.pm
  7. +9 −0 t/00-load.t
  8. +49 −0 t/analyze-response.t
  9. +55 −0 t/boilerplate.t
  10. +18 −0 t/pod-coverage.t
  11. +12 −0 t/pod.t
@@ -0,0 +1,5 @@
+Revision history for Test-Varnish
+
+0.01 Date/time
+ First version, released on an unsuspecting world.
+
@@ -0,0 +1,11 @@
+Changes
+examples/live-sites
+lib/Test/Varnish.pm
+Makefile.PL
+MANIFEST
+README
+t/00-load.t
+t/analyze-response.t
+t/boilerplate.t
+t/pod-coverage.t
+t/pod.t
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ NAME => 'Test::Varnish',
+ AUTHOR => 'Cosimo Streppone <cosimo@cpan.org>',
+ VERSION_FROM => 'lib/Test/Varnish.pm',
+ ABSTRACT_FROM => 'lib/Test/Varnish.pm',
+ PL_FILES => {},
+ PREREQ_PM => {
+ 'Test::More' => 0,
+ 'HTTP::Request' => 0,
+ 'HTTP::Response' => 0,
+ 'HTTP::Cookies' => 0,
+ 'LWP::UserAgent' => 0,
+ 'Getopt::Long' => 0,
+ 'URI' => 0,
+ },
+ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
+ clean => { FILES => 'Test-Varnish-*' },
+);
52 README
@@ -0,0 +1,52 @@
+Test-Varnish
+
+The README is used to introduce the module and provide instructions on
+how to install the module, any machine dependencies it may have (for
+example C compilers and installed libraries) and any other information
+that should be provided before the module is installed.
+
+A README file is required for CPAN modules since CPAN extracts the README
+file from a module distribution so that people browsing the archive
+can use it to get an idea of the module's uses. It is usually a good idea
+to provide version information here so that people can decide whether
+fixes for the module are worth downloading.
+
+
+INSTALLATION
+
+To install this module, run the following commands:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+SUPPORT AND DOCUMENTATION
+
+After installing, you can find documentation for this module with the
+perldoc command.
+
+ perldoc Test::Varnish
+
+You can also look for information at:
+
+ RT, CPAN's request tracker
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Varnish
+
+ AnnoCPAN, Annotated CPAN documentation
+ http://annocpan.org/dist/Test-Varnish
+
+ CPAN Ratings
+ http://cpanratings.perl.org/d/Test-Varnish
+
+ Search CPAN
+ http://search.cpan.org/dist/Test-Varnish
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2010 Cosimo Streppone
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
@@ -0,0 +1,40 @@
+#!/usr/bin/env perl
+#
+# Sniff some random (norwegian) websites for Varnish presence.
+# Varnish is a very popular software in Norway.
+# In fact, it comes from Norway :)
+#
+# If you didn't install Test::Varnish yet,
+# run it with:
+#
+# perl -I../lib ./live-sites
+
+use strict;
+use warnings;
+use Test::Varnish;
+use Test::More;
+
+plan tests => 3;
+
+my $test_ua = Test::Varnish->new({
+ verbose => 1
+});
+
+$test_ua->is_cached(
+ {
+ url => 'http://www.digi.no/',
+ }, 'Digi.no frontpage is using Varnish'
+);
+
+$test_ua->isnt_cached(
+ {
+ url => 'http://www.finn.no/',
+ }, 'Finn.no frontpage does not have Varnish headers'
+);
+
+$test_ua->isnt_cached(
+ {
+ url => 'http://www.opera.com',
+ }, 'Opera Software main website does not use Varnish'
+);
+
Oops, something went wrong.

0 comments on commit c861d7d

Please sign in to comment.