test/test_parser.rb in sanitize-6.0.0 vs test/test_parser.rb in sanitize-6.0.1
- old
+ new
@@ -4,30 +4,30 @@
describe 'Parser' do
make_my_diffs_pretty!
parallelize_me!
it 'should translate valid entities into characters' do
- Sanitize.fragment("'é&").must_equal("'é&")
+ _(Sanitize.fragment("'é&")).must_equal("'é&")
end
it 'should translate orphaned ampersands into entities' do
- Sanitize.fragment('at&t').must_equal('at&t')
+ _(Sanitize.fragment('at&t')).must_equal('at&t')
end
it 'should not add newlines after tags when serializing a fragment' do
- Sanitize.fragment("<div>foo\n\n<p>bar</p><div>\nbaz</div></div><div>quux</div>", :elements => ['div', 'p'])
+ _(Sanitize.fragment("<div>foo\n\n<p>bar</p><div>\nbaz</div></div><div>quux</div>", :elements => ['div', 'p']))
.must_equal "<div>foo\n\n<p>bar</p><div>\nbaz</div></div><div>quux</div>"
end
it 'should not have the Nokogiri 1.4.2+ unterminated script/style element bug' do
- Sanitize.fragment('foo <script>bar').must_equal 'foo '
- Sanitize.fragment('foo <style>bar').must_equal 'foo '
+ _(Sanitize.fragment('foo <script>bar')).must_equal 'foo '
+ _(Sanitize.fragment('foo <style>bar')).must_equal 'foo '
end
it 'ambiguous non-tag brackets like "1 > 2 and 2 < 1" should be parsed correctly' do
- Sanitize.fragment('1 > 2 and 2 < 1').must_equal '1 > 2 and 2 < 1'
- Sanitize.fragment('OMG HAPPY BIRTHDAY! *<:-D').must_equal 'OMG HAPPY BIRTHDAY! *<:-D'
+ _(Sanitize.fragment('1 > 2 and 2 < 1')).must_equal '1 > 2 and 2 < 1'
+ _(Sanitize.fragment('OMG HAPPY BIRTHDAY! *<:-D')).must_equal 'OMG HAPPY BIRTHDAY! *<:-D'
end
describe 'when siblings are added after a node during traversal' do
it 'the added siblings should be traversed' do
html = %[
@@ -57,10 +57,10 @@
return {:node_allowlist => [env[:node]]}
})
# All siblings should be traversed, and in the order added.
- siblings.must_equal [
+ _(siblings).must_equal [
"added_one_one_one",
"added_one_one",
"added_one_two",
"added_one",
"added_two_one_one",