Browse files

Test for stripping tags from a frozen string.

This test will pass under Ruby 1.8 but fail under Ruby 1.9 because of
the change in behavior of gsub! w.r.t. frozen strings that do not
match the pattern used [ruby-core:23664].
  • Loading branch information...
1 parent 93641ed commit c09538941fad7929955ada73cc796e918af415ca @jballanc jballanc committed Apr 15, 2011
Showing with 1 addition and 0 deletions.
  1. +1 −0 actionpack/test/template/html-scanner/sanitizer_test.rb
@@ -20,6 +20,7 @@ def test_strip_tags
assert_equal "This has a here.", sanitizer.sanitize("This has a <![CDATA[<section>]]> here.")
assert_equal "This has an unclosed ", sanitizer.sanitize("This has an unclosed <![CDATA[<section>]] here...")
[nil, '', ' '].each { |blank| assert_equal blank, sanitizer.sanitize(blank) }
+ assert_nothing_raised { sanitizer.sanitize("This is a frozen string with no tags".freeze) }
def test_strip_links

0 comments on commit c095389

Please sign in to comment.