Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 39 lines (32 sloc) 2.307 kb
1dd7321 @dandv Made all tests use strict, removed t/c/journal.t (leftover from old d…
dandv authored
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
fc5d3d9 @LiNiO Formatter/YouTube.pm: Allow to embed youtube video player
LiNiO authored
4 use MojoMojo::Formatter::YouTube;
5fa0a0a @dandv Updated tests to use DummyCatalystObject instead of repeatedly defini…
dandv authored
5 use Test::More tests => 5;
6 use lib 't/lib';
24e80be @dandv Renamed DummyCatalystObject to FakeCatalystObject per 'xUnit Patterns'
dandv authored
7 use FakeCatalystObject;
fc5d3d9 @LiNiO Formatter/YouTube.pm: Allow to embed youtube video player
LiNiO authored
8
5fa0a0a @dandv Updated tests to use DummyCatalystObject instead of repeatedly defini…
dandv authored
9 my $content;
24e80be @dandv Renamed DummyCatalystObject to FakeCatalystObject per 'xUnit Patterns'
dandv authored
10 my $fake_c = FakeCatalystObject->new;
fc5d3d9 @LiNiO Formatter/YouTube.pm: Allow to embed youtube video player
LiNiO authored
11
12 $content = " youtube http://www.youtube.com/abc";
13 MojoMojo::Formatter::YouTube->format_content(\$content, $fake_c, undef);
14 #warn("Content is $content");
5fa0a0a @dandv Updated tests to use DummyCatalystObject instead of repeatedly defini…
dandv authored
15 is($content, " youtube http://www.youtube.com/abc\n", "no youtube formatter line");
fc5d3d9 @LiNiO Formatter/YouTube.pm: Allow to embed youtube video player
LiNiO authored
16
17 $fake_c->set_reverse('pageadmin/edit');
18 $content = "{{youtube http://www.youtube.com/v=abcABC0}}\n";
19 MojoMojo::Formatter::YouTube->format_content(\$content, $fake_c, undef);
20 #warn("Content is $content");
5fa0a0a @dandv Updated tests to use DummyCatalystObject instead of repeatedly defini…
dandv authored
21 is($content, qq(<div style='width: 425px;height: 344px; border: 1px black dotted;'>Faking localization... YouTube Video ...fake complete.<br /><a href="http://www.youtube.com/v=abcABC0">http://www.youtube.com/v=abcABC0</a></div>\n));
fc5d3d9 @LiNiO Formatter/YouTube.pm: Allow to embed youtube video player
LiNiO authored
22
23 $fake_c->set_reverse('jsrpc/render');
24 $content = "{{youtube http://www.youtube.com/v=abcABC0}} xx\n";
25 MojoMojo::Formatter::YouTube->format_content(\$content, $fake_c, undef);
26 #warn("Content is $content");
5fa0a0a @dandv Updated tests to use DummyCatalystObject instead of repeatedly defini…
dandv authored
27 is($content, qq(<div style='width: 425px;height: 344px; border: 1px black dotted;'>Faking localization... YouTube Video ...fake complete.<br /><a href="http://www.youtube.com/v=abcABC0">http://www.youtube.com/v=abcABC0</a></div> xx\n));
fc5d3d9 @LiNiO Formatter/YouTube.pm: Allow to embed youtube video player
LiNiO authored
28
29 $content = "{{youtube http://wwwwwwww.youtube.com/abc}}";
30 MojoMojo::Formatter::YouTube->format_content(\$content, $fake_c, undef);
31 #warn("Content is $content");
5fa0a0a @dandv Updated tests to use DummyCatalystObject instead of repeatedly defini…
dandv authored
32 is($content, "Faking localization... YouTube Video ...fake complete.: http://wwwwwwww.youtube.com/abc Faking localization... is not a valid link to youtube video ...fake complete.\n", "no youtube link");
fc5d3d9 @LiNiO Formatter/YouTube.pm: Allow to embed youtube video player
LiNiO authored
33
34 $fake_c->set_reverse('');
35 $content = "{{youtube http://www.youtube.com/watch?v=ABC_abc_09}}";
36 MojoMojo::Formatter::YouTube->format_content(\$content, $fake_c, undef);
37 #warn("Content is $content");
38 is($content, qq(<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ABC_abc_09&hl=en"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ABC_abc_09&hl=en" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>\n));
Something went wrong with that request. Please try again.