]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - t/openiduser.t
Update user name and pronouns, sorry for modifying other people's writing, hope it...
[git.ikiwiki.info.git] / t / openiduser.t
index fe4d2b445313a0ae94cbb1a9d42d1ca4d1b56204..74609010311bab89aec092215aa5a8e21663d298 100755 (executable)
@@ -10,17 +10,29 @@ BEGIN {
                eval q{use Test::More skip_all => "Net::OpenID::VerifiedIdentity not available"};
        }
        else {
-               eval q{use Test::More tests => 9};
+               eval q{use Test::More tests => 11};
        }
-       use_ok("IkiWiki::Plugin::openid");
+       use_ok("IkiWiki");
 }
 
 # 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]');
 
+# yahoo has an anchor in the url
+is(IkiWiki::openiduser('https://me.yahoo.com/joeyhess#35f22'), 'joeyhess [me.yahoo.com]');
+# google urls are horrendous, but the worst bit is after a ?, so can be dropped
+is(IkiWiki::openiduser('https://www.google.com/accounts/o8/id?id=AItOawm-ebiIfxbKD3KNa-Cu9LvvD9edMLW7BAo'), 'id [www.google.com/accounts/o8]');
+
 # and some less typical ones taken from the ikiwiki commit history
 
 is(IkiWiki::openiduser('http://thm.id.fedoraproject.org/'), 'thm [id.fedoraproject.org]');