summaryrefslogtreecommitdiff
path: root/t/openiduser.t
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-12-30 18:24:36 +0100
committerintrigeri <intrigeri@boum.org>2008-12-30 18:24:36 +0100
commit21add7ffa87a5e622d18bdbb24c638c15bdb3800 (patch)
tree6780aa6dbee71f18db64e44b012e789fc8197d4b /t/openiduser.t
parent3190e5cea75a43d38f58b8a45fbc87d5527d18f0 (diff)
parent3032909090711c86c5056987043eeff5a1f6aec2 (diff)
Merge commit 'upstream/master' into prv/po
Conflicts: debian/control debian/copyright doc/ikiwiki/pagespec.mdwn Signed-off-by: intrigeri <intrigeri@boum.org>
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]');