aboutsummaryrefslogtreecommitdiff
path: root/t/openiduser.t
diff options
context:
space:
mode:
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-21 16:37:20 +0000
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>2008-12-21 16:37:20 +0000
commitf0c76aa51ca7a1dbfb8fcfa679baa114e563b895 (patch)
tree4729e9cc2e3325b78c70e8bbee64631c847ede9e /t/openiduser.t
parent801dc76bf0e066558cc6ea179073104fb6a67c92 (diff)
downloadikiwiki-f0c76aa51ca7a1dbfb8fcfa679baa114e563b895.tar
ikiwiki-f0c76aa51ca7a1dbfb8fcfa679baa114e563b895.tar.gz
Add a regression test for &openiduser
Diffstat (limited to 't/openiduser.t')
-rwxr-xr-xt/openiduser.t30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/openiduser.t b/t/openiduser.t
new file mode 100755
index 000000000..fe4d2b445
--- /dev/null
+++ b/t/openiduser.t
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+
+BEGIN {
+ eval q{
+ use Net::OpenID::VerifiedIdentity;
+ };
+ if ($@) {
+ eval q{use Test::More skip_all => "Net::OpenID::VerifiedIdentity not available"};
+ }
+ else {
+ eval q{use Test::More tests => 9};
+ }
+ use_ok("IkiWiki::Plugin::openid");
+}
+
+# Some typical examples:
+
+is(IkiWiki::openiduser('http://josephturian.blogspot.com'), 'josephturian [blogspot.com]');
+is(IkiWiki::openiduser('http://yam655.livejournal.com/'), 'yam655 [livejournal.com]');
+is(IkiWiki::openiduser('http://id.mayfirst.org/jamie/'), 'jamie [id.mayfirst.org]');
+
+# and some less typical ones taken from the ikiwiki commit history
+
+is(IkiWiki::openiduser('http://thm.id.fedoraproject.org/'), 'thm [id.fedoraproject.org]');
+is(IkiWiki::openiduser('http://dtrt.org/'), 'dtrt.org');
+is(IkiWiki::openiduser('http://alcopop.org/me/openid/'), 'openid [alcopop.org/me]');
+is(IkiWiki::openiduser('http://id.launchpad.net/882/bielawski1'), 'bielawski1 [id.launchpad.net/882]');
+is(IkiWiki::openiduser('http://technorati.com/people/technorati/drajt'), 'drajt [technorati.com/people/technorati]');