LinkEmbedder
view release on metacpan or search on metacpan
t/paste-debian.t view on Meta::CPAN
use Mojo::Base -strict;
use Test::More;
use LinkEmbedder;
plan skip_all => 'TEST_ONLINE=1' unless $ENV{TEST_ONLINE};
plan skip_all => 'cpanm IO::Socket::SSL' unless LinkEmbedder::TLS;
LinkEmbedder->new->test_ok(
'https://paste.debian.net/?show=1186554' => {
cache_age => 0,
class => 'le-paste le-provider-debian le-rich',
html => paste_debian_html(),
isa => 'LinkEmbedder::Link::Basic',
provider_name => 'Debian',
provider_url => 'https://paste.debian.net/?show=1186554',
title => 'debian Pastezone',
type => 'rich',
url => 'https://paste.debian.net/?show=1186554',
version => '1.0'
}
);
done_testing;
sub paste_debian_html {
return <<'HERE';
<div class="le-paste le-provider-debian le-rich">
<div class="le-meta">
<span class="le-provider-link"><a href="https://paste.debian.net/?show=1186554">Debian</a></span>
<span class="le-goto-link"><a href="https://paste.debian.net/?show=1186554" title="debian Pastezone">View</a></span>
</div>
<pre>#!/bin/bash
theIp=$(printf "<redacted IPv6 prefix>$(echo -n $1 | sha1sum | head -c 16 | sed 's/..../:&/g')\n")
echo "User: $1"
echo "\"$theIp/64\""
## Example output
$ bash genip.sh Batman
User: Batman
"<redacted IPv6 prefix>:32b2:6a27:1530:f105/64"
</pre>
</div>
HERE
}
( run in 2.310 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )