diff --git a/spec/lib/banzai/filter/inline_math_filter_spec.rb b/spec/lib/banzai/filter/inline_math_filter_spec.rb index e6cccd79723bf02cc0df59d83b17aab36abfa038..01d791f9ca1ce34a141d18cd57d985da792a778b 100644 --- a/spec/lib/banzai/filter/inline_math_filter_spec.rb +++ b/spec/lib/banzai/filter/inline_math_filter_spec.rb @@ -4,8 +4,9 @@ describe Banzai::Filter::InlineMathFilter, lib: true do include FilterSpecHelper it 'leaves regular inline code unchanged' do - doc = filter("2+2") - expect(doc.to_s).to eq "2+2" + input = "2+2" + doc = filter(input) + expect(doc.to_s).to eq input end it 'removes surrounding dollar signs and adds class' do @@ -24,18 +25,21 @@ describe Banzai::Filter::InlineMathFilter, lib: true do end it 'ignores cases with missing dolar sign at the end' do - doc = filter("test $2+2 test") - expect(doc.to_s).to eq 'test $2+2 test' + input = "test $2+2 test" + doc = filter(input) + expect(doc.to_s).to eq input end it 'ignores cases with missing dolar sign at the beginning' do - doc = filter("test 2+2$ test") - expect(doc.to_s).to eq 'test 2+2$ test' + input = "test 2+2$ test" + doc = filter(input) + expect(doc.to_s).to eq input end it 'ignores dollar signs if it is not adjacent' do - doc = filter("$test 2+2$ test") - expect(doc.to_s).to eq '$test 2+2$ test' + input = '

We check strictly $2+2 and 2+2$

' + doc = filter(input) + expect(doc.to_s).to eq input end end