Skip to content

Instantly share code, notes, and snippets.

@viliampucik
Created November 12, 2011 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viliampucik/1360565 to your computer and use it in GitHub Desktop.
Save viliampucik/1360565 to your computer and use it in GitHub Desktop.
perl-html-wikiconverter
--- HTML-WikiConverter-0.68/t/01-wikiconverter.t 2009-03-08 03:24:42.000000000 +0100
+++ HTML-WikiConverter-0.68-new/t/01-wikiconverter.t 2011-12-11 14:41:32.779254868 +0100
@@ -71,10 +71,9 @@
package main;
-use Test::More tests => 53;
+use Test::More tests => 49;
use HTML::WikiConverter;
-my $have_lwp = eval "use LWP::UserAgent; 1";
my $have_query_param = eval "use URI::QueryParam; 1";
my $wc = new HTML::WikiConverter(
@@ -155,21 +154,6 @@
is( $wc4->html2wiki( html => '<', escape_entities => 1 ), '<', "escape entities" );
is( $wc4->html2wiki( html => '<' ), '<', "escape_entities is enabled by default" );
-SKIP: {
- skip "LWP::UserAgent required for testing how content is fetched from URIs" => 4 unless $have_lwp;
- skip "Couldn't fetch test website http://www.perl.org. Perhaps you don't have internet access?" => 4 unless LWP::UserAgent->new->get('http://www.perl.org')->is_success;
-
- is( $wc4->html2wiki( uri => 'http://diberri.dyndns.org/wikipedia/html2wiki-old/test.html', strip_tags => ['head'] ), '**test**', 'fetch uri, no ua' );
- is( $wc4->user_agent->agent, $wc4->__default_ua_string, 'using default ua' );
-
- my $ua_agent = 'html2wiki-test/0.5x';
- my $ua = new LWP::UserAgent( agent => $ua_agent );
- $wc4->user_agent($ua);
-
- is( $wc4->html2wiki( uri => 'http://diberri.dyndns.org/wikipedia/html2wiki-old/test.html', strip_tags => ['head'] ), '**test**', 'fetch uri w/ ua' );
- is( $wc4->user_agent->agent, $ua_agent, 'using user-specified ua' );
-};
-
eval { $wc4->html2wiki( url => '...' ) };
ok( $@ =~ /not a valid argument/, 'url not a valid argument to html2wiki()' );
# Contributor: Viliam Pucik <viliam.pucik@gmail.com>
# Generator : CPANPLUS::Dist::Arch 1.19
pkgname='perl-html-wikiconverter'
pkgver='0.68'
pkgrel='2'
pkgdesc="Convert HTML to wiki markup"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-class-data-inheritable>=0.02' 'perl-css>=1.07' 'perl-html-parser' 'perl-html-tagset>=3.04' 'perl-html-tree>=3.18' 'perl-params-validate>=0.77' 'perl-uri>=1.35')
makedepends=()
url='http://search.cpan.org/dist/HTML-WikiConverter'
source=('http://search.cpan.org/CPAN/authors/id/D/DI/DIBERRI/HTML-WikiConverter-0.68.tar.gz' 'no-useragent-tests.patch')
md5sums=('e6d8b16c23b6f38c51d8585f3423aca9'
'8006fb9018494d74ff117a8753f1e66b')
sha512sums=('e80e9053dd01dfbea587ed2816a282abc4083021d3d80b72b1e2ea2d1ce0b45226bcf0c863beddc7a2bc15fece7b8bfa78e33ee409460776a5ef2de57beae7ee'
'709a33fb8a97dca9edf22865eb1781d86638432b840b9ed47897982155ce1243c730585c17d7497113698577c4107000571f001eae40cd76ffeb80da98ab68fd')
_distdir="${srcdir}/HTML-WikiConverter-0.68"
build() {
cd "$_distdir"
patch -p1 < ../no-useragent-tests.patch
( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
PERL_AUTOINSTALL=--skipdeps \
PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
MODULEBUILDRC=/dev/null
/usr/bin/perl Makefile.PL
make
)
}
check() {
cd "$_distdir"
( export PERL_MM_USE_DEFAULT=1 PERL5LIB=""
make test
)
}
package() {
cd "$_distdir"
make install
find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}
# Local Variables:
# mode: shell-script
# sh-basic-offset: 2
# End:
# vim:set ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment