diff options
author | Alex Young <alex@bytemark.co.uk> | 2015-04-16 12:32:55 +0100 |
---|---|---|
committer | Alex Young <alex@bytemark.co.uk> | 2015-04-16 12:32:55 +0100 |
commit | 0c20e0fa286fdd948cf941a03a350fe28e2b751e (patch) | |
tree | 4ab9f0cb3b39afbc256c9be27c858ea9eb0c14a3 /test/tc_mauve_alert.rb | |
parent | affb4ec63d93eb0c9b4e6eec56fb2dc741918e1d (diff) |
Use 1.9's Encoding to do do away with UTF8-checking in mauve/alert.rb
Diffstat (limited to 'test/tc_mauve_alert.rb')
-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 |