Accept a certain amount of whitespace in the results returned by the 
HTML cleaner.

        Patch by fu. 

diffs (40 lines):

diff -r f91104d03d57 -r 2bd57d9f7bf5 t/clean-embed.t
--- a/t/clean-embed.t   Wed Feb 16 16:10:51 2011 -0600
+++ b/t/clean-embed.t   Thu Feb 17 17:51:10 2011 +0800
@@ -218,9 +218,9 @@ note( "Testing parse_embed (We parse the
             qq{foo <site-embed id="1"> </site-embed> bar},
 
             qq{foo <site-embed id="1"/> bar},
-            qq{foo <site-embed id="1"></site-embed> bar},
+            qr{foo <site-embed id="1">\s*</site-embed> bar},
             qr{foo $iframe bar},
-            qq{},
+            qr{\s*},
         ],
 
 
@@ -407,7 +407,11 @@ note( "Testing parse_embed (We parse the
         # edit the post
         my $expanded_entry = $got_post_saved;
         LJ::EmbedModule->expand_entry( $u, \$expanded_entry, edit => 1 );
-        is( $expanded_entry, $expected_edit, "expand_entry: $title" );
+        if ( ref $expected_edit && ref $expected_edit eq "Regexp" ) {
+            like( $expanded_entry, $expected_edit, "expand entry: $title" );
+        } else {
+            is( $expanded_entry, $expected_edit, "expand_entry: $title" );
+        }
 
         # view the post in your journal (get iframe if applicable)
         my $viewed_entry = $got_post_saved;
@@ -436,6 +440,10 @@ note( "Testing parse_embed (We parse the
         # check the iframe contents
         # LJ::EmbedModule takes the content and cleans it
         my $got_embed = LJ::EmbedModule->module_content( journalid => 
$u->userid, moduleid => 1 );
-        is( $got_embed, $expected_iframe, "clean_embed: $title" );
+        if( ref $expected_iframe && ref $expected_iframe eq "Regexp" ) {
+            like( $got_embed, $expected_iframe, "clean_embed: $title" );
+        } else {
+            is( $got_embed, $expected_iframe, "clean_embed: $title" );
+        }
     }
 }
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to