# t/clean-embed.t
#
# Test LJ::CleanHTML::clean_embed.
#
# Authors:
# Afuna
# Jen Griffin
# Andrea Nall
#
# Copyright (c) 2013 by Dreamwidth Studios, LLC.
#
# This program is free software; you may redistribute it and/or modify it under
# the same terms as Perl itself. For a copy of the license, please reference
# 'perldoc perlartistic' or 'perldoc perlgpl'.
#
use strict;
use warnings;
use Test::More tests => 189;
BEGIN { $LJ::_T_CONFIG = 1; require "$ENV{LJHOME}/cgi-bin/ljlib.pl"; }
use LJ::CleanHTML;
use LJ::EmbedModule;
use LJ::Test qw( temp_user );
note("Testing clean_embed (we provide the contents to be cleaned directly)");
{
my ( $orig_post, $clean_post, $saved_post );
my $clean = sub {
my ($opts) = @_;
LJ::CleanHTML::clean_embed( \$orig_post, $opts );
};
note("no content");
$orig_post = qq{};
$clean_post = qq{};
$clean->();
is( $orig_post, $clean_post, "empty" );
note("simple object");
$orig_post = qq{};
$clean_post = qq{};
$clean->();
is( $orig_post, $clean_post, "basic