root/lang/perl/mobirc/trunk/t/Plugins/Filter/clickable.t @ 6183

Revision 6183, 2.3 kB (checked in by cho45, 5 years ago)

lang/perl/mobirc/trunk/t/Plugins/Filter/clickable.t:

すいません。テストを更新するのを忘れていました。

Line 
1use strict;
2use warnings;
3use Test::Base;
4use App::Mobirc::Plugin::MessageBodyFilter::Clickable;
5
6plan tests => 1*blocks;
7
8filters {
9    input => ['yaml', 'clickable' ]
10};
11
12sub clickable {
13    my $x = shift;
14    App::Mobirc::Plugin::MessageBodyFilter::Clickable::process( $x->{text}, $x->{conf} );
15}
16
17run_is input => 'expected';
18
19__END__
20
21=== basic
22--- input
23text: http://d.hatena.ne.jp/
24conf: ~
25--- expected: <a href="http://d.hatena.ne.jp/" rel="nofollow" class="url">http://d.hatena.ne.jp/</a>
26
27=== basic scheme restrict
28--- input
29text: http://d.hatena.ne.jp/
30conf:
31  accept_schemes: [mailto]
32--- expected: http://d.hatena.ne.jp/
33
34=== basic with http_link_string
35--- input
36text: http://d.hatena.ne.jp/hatenachan/
37conf:
38  http_link_string: $host$path
39--- expected: <a href="http://d.hatena.ne.jp/hatenachan/" rel="nofollow" class="url">d.hatena.ne.jp/hatenachan/</a>
40
41=== tel
42--- input
43text: 000-0000-0000
44conf: ~
45--- expected: <a href="tel:00000000000" rel="nofollow" class="url">000-0000-0000</a>
46
47=== tel with scheme
48--- input
49text: tel:000-0000-0000
50conf: ~
51--- expected: <a href="tel:00000000000" rel="nofollow" class="url">tel:000-0000-0000</a>
52
53=== mailto
54--- input
55text: aaa@example.com
56conf: ~
57--- expected: <a href="mailto:aaa@example.com" rel="nofollow" class="url">aaa@example.com</a>
58
59=== mailto with scheme
60--- input
61text: mailto:aaa@example.com
62conf: ~
63--- expected: <a href="mailto:aaa@example.com" rel="nofollow" class="url">mailto:aaa@example.com</a>
64
65=== pocket hatena
66--- input
67text: http://d.hatena.ne.jp/
68conf:
69  pocket_hatena: true
70--- expected: <a href="http://d.hatena.ne.jp/" rel="nofollow" class="url">http://d.hatena.ne.jp/</a><a href="http://mgw.hatena.ne.jp/?url=http%3A%2F%2Fd.hatena.ne.jp%2F;noimage=0;split=1" rel="nofollow" class="pocket_hatena">[ph]</a>
71
72=== au_pcsv
73--- input
74text: http://d.hatena.ne.jp/
75conf:
76  au_pcsv: true
77--- expected: <a href="http://d.hatena.ne.jp/" rel="nofollow" class="url">http://d.hatena.ne.jp/</a><a href="device:pcsiteviewer?url=http://d.hatena.ne.jp/" rel="nofollow" class="au_pcsv">[PCSV]</a>
78
79=== google_gwt
80--- input
81text: http://d.hatena.ne.jp/
82conf:
83  google_gwt: true
84--- expected: <a href="http://d.hatena.ne.jp/" rel="nofollow" class="url">http://d.hatena.ne.jp/</a><a href="http://www.google.co.jp/gwt/n?u=http%3A%2F%2Fd.hatena.ne.jp%2F;_gwt_noimg=0" rel="nofollow" class="google_gwt">[gwt]</a>
85
Note: See TracBrowser for help on using the browser.