aboutsummaryrefslogtreecommitdiff
path: root/t/openiduser.t
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-04-04 17:27:48 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-04-04 17:27:48 -0400
commit8e92468eae9ac0ab8161a0c71ff6c6a0a8aef07a (patch)
tree9e26465e0ca98a5f3cbc6c72a0cace4bf83b93db /t/openiduser.t
parent78a69e5bd632eb86ef8135e9c1d05d2c48b43362 (diff)
parent08fda4c9d374de1d3de3172a192d4d915d3dc0c1 (diff)
downloadikiwiki-8e92468eae9ac0ab8161a0c71ff6c6a0a8aef07a.tar
ikiwiki-8e92468eae9ac0ab8161a0c71ff6c6a0a8aef07a.tar.gz
Merge branch 'master'
Conflicts: doc/ikiwiki-makerepo.mdwn
Diffstat (limited to 't/openiduser.t')
-rwxr-xr-xt/openiduser.t37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/openiduser.t b/t/openiduser.t
new file mode 100755
index 000000000..52d879484
--- /dev/null
+++ b/t/openiduser.t
@@ -0,0 +1,37 @@
+#!/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:
+
+# This test, when run by Test::Harness using perl -w, exposes a warning in
+# Net::OpenID::VerifiedIdentity. Normally that warning is not displayed, as
+# that module does not use warnings. To avoid cluttering the test output,
+# disable the -w switch temporarily.
+$^W=0;
+is(IkiWiki::openiduser('http://josephturian.blogspot.com'), 'josephturian [blogspot.com]');
+$^W=1;
+
+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]');