99class HTMLPipelineTest < Minitest ::Test
1010 def setup
1111 @default_context = { }
12- @pipeline = HTMLPipeline . new ( text_filters : [ TestTextFilter . new ] , default_context : @default_context )
12+ @pipeline = HTMLPipeline . new ( text_filters : [ TestReverseFilter . new ] , default_context : @default_context )
1313 end
1414
1515 def test_filter_instrumentation
@@ -22,7 +22,7 @@ def test_filter_instrumentation
2222
2323 assert ( event , "event expected" )
2424 assert_equal ( "call_filter.html_pipeline" , event )
25- assert_equal ( TestTextFilter . name , payload [ :filter ] )
25+ assert_equal ( TestReverseFilter . name , payload [ :filter ] )
2626 assert_equal ( @pipeline . class . name , payload [ :pipeline ] )
2727 assert_equal ( body . reverse , payload [ :result ] [ :output ] )
2828 end
@@ -89,7 +89,7 @@ def test_incorrect_convert_filter
8989 def test_convert_filter_needed_for_text_and_html_filters
9090 assert_raises ( HTMLPipeline ::InvalidFilterError ) do
9191 HTMLPipeline . new (
92- text_filters : [ TestTextFilter . new ] ,
92+ text_filters : [ TestReverseFilter . new ] ,
9393 node_filters : [
9494 HTMLPipeline ::NodeFilter ::MentionFilter . new ,
9595 ] ,
@@ -103,4 +103,17 @@ def test_incorrect_node_filters
103103 HTMLPipeline . new ( node_filters : [ HTMLPipeline ::ConvertFilter ::MarkdownFilter ] , default_context : @default_context )
104104 end
105105 end
106+
107+ def test_kitchen_sink
108+ text = "Hey there, @billy. Love to see <marquee>yah</marquee>!"
109+
110+ pipeline = HTMLPipeline . new (
111+ text_filters : [ TestReverseFilter . new , YehBolderFilter . new ] ,
112+ convert_filter : HTMLPipeline ::ConvertFilter ::MarkdownFilter . new ,
113+ node_filters : [ HTMLPipeline ::NodeFilter ::MentionFilter . new ] ,
114+ )
115+ result = pipeline . call ( text ) [ :output ]
116+
117+ assert_equal ( "<p>!>eeuqram/eeuqram< ees ot evoL .yllib@ ,ereht <strong>yeH</strong></p>" , result )
118+ end
106119end
0 commit comments