diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/tc_mauve_alert.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/tc_mauve_alert.rb b/test/tc_mauve_alert.rb index 3f22030..7456d20 100644 --- a/test/tc_mauve_alert.rb +++ b/test/tc_mauve_alert.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 $:.unshift "../lib" @@ -494,4 +495,17 @@ EOF end + + def test_remove_html_utf_8 + problem_string = "<pre>This is a ûŧđ ™ message.\n\n</pre><hr/>" + fixed_string = Alert.remove_html(problem_string) + assert_equal "This is a ûŧđ ™ message.", fixed_string.strip + end + + def test_remove_html_invalid_character + problem_string = "caf\xa9".force_encoding("ascii") + fixed_string = Alert.remove_html(problem_string) + assert_equal "caf?", fixed_string + end + end |