Sha256: df7b7fa8d6448a01bc37b6408cee6a2b426c9f7fc2545a76520d6ed32d199bb0
Contents?: true
Size: 1.33 KB
Versions: 2
Compression:
Stored size: 1.33 KB
Contents
require './test/helper.rb' require "htmlfilter" class TestHTMLFilter < MicroTest::TestCase # core tests def test_strip_single hf = HTMLFilter.new hf.send(:strip_single,'\"').assert == '"' hf.send(:strip_single,'\0').assert == "\000" end # functional tests def assert_filter(filtered, original) original.html_filter.assert == filtered end def test_fix_quotes assert_filter '<img src="foo.jpg" />', "<img src=\"foo.jpg />" end def test_basics assert_filter '', '' assert_filter 'hello', 'hello' end def test_balancing_tags assert_filter "<b>hello</b>", "<<b>hello</b>" assert_filter "<b>hello</b>", "<b>>hello</b>" assert_filter "<b>hello</b>", "<b>hello<</b>" assert_filter "<b>hello</b>", "<b>hello</b>>" assert_filter "", "<>" end def test_tag_completion assert_filter "hello", "hello<b>" assert_filter "<b>hello</b>", "<b>hello" assert_filter "hello<b>world</b>", "hello<b>world" assert_filter "hello", "hello</b>" assert_filter "hello", "hello<b/>" assert_filter "hello<b>world</b>", "hello<b/>world" assert_filter "<b><b><b>hello</b></b></b>", "<b><b><b>hello" assert_filter "", "</b><b>" end def test_end_slashes assert_filter '<img />', '<img>' assert_filter '<img />', '<img/>' assert_filter '', '<b/></b>' end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
htmlfilter-1.3.0 | test/test_htmlfilter.rb |
htmlfilter-1.2.1 | test/test_htmlfilter.rb |