Package: ruby-sanitize / 6.0.0-1.1+deb12u1

Update-tests-to-remove-deprecated-minitest-must_be.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
From: Roman Vakulchik <rvakulchik@gmail.com>
Date: Fri, 20 Aug 2021 16:43:30 +0200
Subject: Update tests to remove deprecated minitest 'must_be'
Origin: https://github.com/rgrove/sanitize/commit/a37a51b583fa4a97486d47e32625dae1baf0574c

---
 .github/workflows/tests.yml |   2 +-
 test/test_clean_comment.rb  |  32 +++----
 test/test_clean_css.rb      |  10 +-
 test/test_clean_doctype.rb  |  30 +++---
 test/test_clean_element.rb  | 184 ++++++++++++++++++------------------
 test/test_config.rb         |  18 ++--
 test/test_malicious_css.rb  |  14 +--
 test/test_malicious_html.rb |  62 ++++++------
 test/test_parser.rb         |  16 ++--
 test/test_sanitize.rb       |  48 +++++-----
 test/test_sanitize_css.rb   | 106 ++++++++++-----------
 test/test_transformers.rb   |  74 +++++++--------
 12 files changed, 298 insertions(+), 298 deletions(-)

diff --git a/test/test_clean_comment.rb b/test/test_clean_comment.rb
index d118c827e438..a02c76c46b2f 100644
--- a/test/test_clean_comment.rb
+++ b/test/test_clean_comment.rb
@@ -11,18 +11,18 @@ describe 'Sanitize::Transformers::CleanComment' do
     end
 
     it 'should remove comments' do
-      @s.fragment('foo <!-- comment --> bar').must_equal 'foo  bar'
-      @s.fragment('foo <!-- ').must_equal 'foo '
-      @s.fragment('foo <!-- - -> bar').must_equal 'foo '
-      @s.fragment("foo <!--\n\n\n\n-->bar").must_equal 'foo bar'
-      @s.fragment("foo <!-- <!-- <!-- --> --> -->bar").must_equal 'foo  --&gt; --&gt;bar'
-      @s.fragment("foo <div <!-- comment -->>bar</div>").must_equal 'foo <div>&gt;bar</div>'
+      _(@s.fragment('foo <!-- comment --> bar')).must_equal 'foo  bar'
+      _(@s.fragment('foo <!-- ')).must_equal 'foo '
+      _(@s.fragment('foo <!-- - -> bar')).must_equal 'foo '
+      _(@s.fragment("foo <!--\n\n\n\n-->bar")).must_equal 'foo bar'
+      _(@s.fragment("foo <!-- <!-- <!-- --> --> -->bar")).must_equal 'foo  --&gt; --&gt;bar'
+      _(@s.fragment("foo <div <!-- comment -->>bar</div>")).must_equal 'foo <div>&gt;bar</div>'
 
       # Special case: the comment markup is inside a <script>, which makes it
       # text content and not an actual HTML comment.
-      @s.fragment("<script><!-- comment --></script>").must_equal ''
+      _(@s.fragment("<script><!-- comment --></script>")).must_equal ''
 
-      Sanitize.fragment("<script><!-- comment --></script>", :allow_comments => false, :elements => ['script'])
+      _(Sanitize.fragment("<script><!-- comment --></script>", :allow_comments => false, :elements => ['script']))
         .must_equal '<script><!-- comment --></script>'
     end
   end
@@ -33,14 +33,14 @@ describe 'Sanitize::Transformers::CleanComment' do
     end
 
     it 'should allow comments' do
-      @s.fragment('foo <!-- comment --> bar').must_equal 'foo <!-- comment --> bar'
-      @s.fragment('foo <!-- ').must_equal 'foo <!-- -->'
-      @s.fragment('foo <!-- - -> bar').must_equal 'foo <!-- - -> bar-->'
-      @s.fragment("foo <!--\n\n\n\n-->bar").must_equal "foo <!--\n\n\n\n-->bar"
-      @s.fragment("foo <!-- <!-- <!-- --> --> -->bar").must_equal 'foo <!-- <!-- <!-- --> --&gt; --&gt;bar'
-      @s.fragment("foo <div <!-- comment -->>bar</div>").must_equal 'foo <div>&gt;bar</div>'
-
-      Sanitize.fragment("<script><!-- comment --></script>", :allow_comments => true, :elements => ['script'])
+      _(@s.fragment('foo <!-- comment --> bar')).must_equal 'foo <!-- comment --> bar'
+      _(@s.fragment('foo <!-- ')).must_equal 'foo <!-- -->'
+      _(@s.fragment('foo <!-- - -> bar')).must_equal 'foo <!-- - -> bar-->'
+      _(@s.fragment("foo <!--\n\n\n\n-->bar")).must_equal "foo <!--\n\n\n\n-->bar"
+      _(@s.fragment("foo <!-- <!-- <!-- --> --> -->bar")).must_equal 'foo <!-- <!-- <!-- --> --&gt; --&gt;bar'
+      _(@s.fragment("foo <div <!-- comment -->>bar</div>")).must_equal 'foo <div>&gt;bar</div>'
+
+      _(Sanitize.fragment("<script><!-- comment --></script>", :allow_comments => true, :elements => ['script']))
         .must_equal '<script><!-- comment --></script>'
     end
   end
diff --git a/test/test_clean_css.rb b/test/test_clean_css.rb
index 4bffaee60059..d10c943d44f1 100644
--- a/test/test_clean_css.rb
+++ b/test/test_clean_css.rb
@@ -10,15 +10,15 @@ describe 'Sanitize::Transformers::CSS::CleanAttribute' do
   end
 
   it 'should sanitize CSS properties in style attributes' do
-    @s.fragment(%[
+    _(@s.fragment(%[
       <div style="color: #fff; width: expression(alert(1)); /* <-- evil! */"></div>
-    ].strip).must_equal %[
+    ].strip)).must_equal %[
       <div style="color: #fff;  /* <-- evil! */"></div>
     ].strip
   end
 
   it 'should remove the style attribute if the sanitized CSS is empty' do
-    @s.fragment('<div style="width: expression(alert(1))"></div>').
+    _(@s.fragment('<div style="width: expression(alert(1))"></div>')).
       must_equal '<div></div>'
   end
 end
@@ -46,7 +46,7 @@ describe 'Sanitize::Transformers::CSS::CleanElement' do
       </style>
     ].strip
 
-    @s.fragment(html).must_equal %[
+    _(@s.fragment(html)).must_equal %[
       <style>
       /* Yay CSS! */
       .foo { color: #fff; }
@@ -62,6 +62,6 @@ describe 'Sanitize::Transformers::CSS::CleanElement' do
   end
 
   it 'should remove the <style> element if the sanitized CSS is empty' do
-    @s.fragment('<style></style>').must_equal ''
+    _(@s.fragment('<style></style>')).must_equal ''
   end
 end
diff --git a/test/test_clean_doctype.rb b/test/test_clean_doctype.rb
index f474ceaf3b7e..9ad356171cc2 100644
--- a/test/test_clean_doctype.rb
+++ b/test/test_clean_doctype.rb
@@ -11,18 +11,18 @@ describe 'Sanitize::Transformers::CleanDoctype' do
     end
 
     it 'should remove doctype declarations' do
-      @s.document('<!DOCTYPE html><html>foo</html>').must_equal "<html>foo</html>"
-      @s.fragment('<!DOCTYPE html>foo').must_equal 'foo'
+      _(@s.document('<!DOCTYPE html><html>foo</html>')).must_equal "<html>foo</html>"
+      _(@s.fragment('<!DOCTYPE html>foo')).must_equal 'foo'
     end
 
     it 'should not allow doctype definitions in fragments' do
-      @s.fragment('<!DOCTYPE html><html>foo</html>')
+      _(@s.fragment('<!DOCTYPE html><html>foo</html>'))
         .must_equal "foo"
 
-      @s.fragment('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html>foo</html>')
+      _(@s.fragment('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html>foo</html>'))
         .must_equal "foo"
 
-      @s.fragment("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html>foo</html>")
+      _(@s.fragment("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html>foo</html>"))
         .must_equal "foo"
     end
   end
@@ -33,38 +33,38 @@ describe 'Sanitize::Transformers::CleanDoctype' do
     end
 
     it 'should allow doctype declarations in documents' do
-      @s.document('<!DOCTYPE html><html>foo</html>')
+      _(@s.document('<!DOCTYPE html><html>foo</html>'))
         .must_equal "<!DOCTYPE html><html>foo</html>"
 
-      @s.document('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html>foo</html>')
+      _(@s.document('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html>foo</html>'))
         .must_equal "<!DOCTYPE html><html>foo</html>"
 
-      @s.document("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html>foo</html>")
+      _(@s.document("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html>foo</html>"))
         .must_equal "<!DOCTYPE html><html>foo</html>"
     end
 
     it 'should not allow obviously invalid doctype declarations in documents' do
-      @s.document('<!DOCTYPE blah blah blah><html>foo</html>')
+      _(@s.document('<!DOCTYPE blah blah blah><html>foo</html>'))
         .must_equal "<!DOCTYPE html><html>foo</html>"
 
-      @s.document('<!DOCTYPE blah><html>foo</html>')
+      _(@s.document('<!DOCTYPE blah><html>foo</html>'))
         .must_equal "<!DOCTYPE html><html>foo</html>"
 
-      @s.document('<!DOCTYPE html BLAH "-//W3C//DTD HTML 4.01//EN"><html>foo</html>')
+      _(@s.document('<!DOCTYPE html BLAH "-//W3C//DTD HTML 4.01//EN"><html>foo</html>'))
         .must_equal "<!DOCTYPE html><html>foo</html>"
 
-      @s.document('<!whatever><html>foo</html>')
+      _(@s.document('<!whatever><html>foo</html>'))
         .must_equal "<html>foo</html>"
     end
 
     it 'should not allow doctype definitions in fragments' do
-      @s.fragment('<!DOCTYPE html><html>foo</html>')
+      _(@s.fragment('<!DOCTYPE html><html>foo</html>'))
         .must_equal "foo"
 
-      @s.fragment('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html>foo</html>')
+      _(@s.fragment('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html>foo</html>'))
         .must_equal "foo"
 
-      @s.fragment("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html>foo</html>")
+      _(@s.fragment("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html>foo</html>"))
         .must_equal "foo"
     end
   end
diff --git a/test/test_clean_element.rb b/test/test_clean_element.rb
index 5b3299c193b2..1293cea17ba2 100644
--- a/test/test_clean_element.rb
+++ b/test/test_clean_element.rb
@@ -163,94 +163,94 @@ describe 'Sanitize::Transformers::CleanElement' do
 
   describe 'Default config' do
     it 'should remove non-allowlisted elements, leaving safe contents behind' do
-      Sanitize.fragment('foo <b>bar</b> <strong><a href="#a">baz</a></strong> quux')
+      _(Sanitize.fragment('foo <b>bar</b> <strong><a href="#a">baz</a></strong> quux'))
         .must_equal 'foo bar baz quux'
 
-      Sanitize.fragment('<script>alert("<xss>");</script>')
+      _(Sanitize.fragment('<script>alert("<xss>");</script>'))
         .must_equal ''
 
-      Sanitize.fragment('<<script>script>alert("<xss>");</<script>>')
+      _(Sanitize.fragment('<<script>script>alert("<xss>");</<script>>'))
         .must_equal '&lt;'
 
-      Sanitize.fragment('< script <>> alert("<xss>");</script>')
+      _(Sanitize.fragment('< script <>> alert("<xss>");</script>'))
         .must_equal '&lt; script &lt;&gt;&gt; alert("");'
     end
 
     it 'should surround the contents of :whitespace_elements with space characters when removing the element' do
-      Sanitize.fragment('foo<div>bar</div>baz')
+      _(Sanitize.fragment('foo<div>bar</div>baz'))
         .must_equal 'foo bar baz'
 
-      Sanitize.fragment('foo<br>bar<br>baz')
+      _(Sanitize.fragment('foo<br>bar<br>baz'))
         .must_equal 'foo bar baz'
 
-      Sanitize.fragment('foo<hr>bar<hr>baz')
+      _(Sanitize.fragment('foo<hr>bar<hr>baz'))
         .must_equal 'foo bar baz'
     end
 
     it 'should not choke on several instances of the same element in a row' do
-      Sanitize.fragment('<img src="http://www.google.com/intl/en_ALL/images/logo.gif"><img src="http://www.google.com/intl/en_ALL/images/logo.gif"><img src="http://www.google.com/intl/en_ALL/images/logo.gif"><img src="http://www.google.com/intl/en_ALL/images/logo.gif">')
+      _(Sanitize.fragment('<img src="http://www.google.com/intl/en_ALL/images/logo.gif"><img src="http://www.google.com/intl/en_ALL/images/logo.gif"><img src="http://www.google.com/intl/en_ALL/images/logo.gif"><img src="http://www.google.com/intl/en_ALL/images/logo.gif">'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `iframe` elements' do
-      Sanitize.fragment('<iframe>hello! <script>alert(0)</script></iframe>')
+      _(Sanitize.fragment('<iframe>hello! <script>alert(0)</script></iframe>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `math` elements' do
-      Sanitize.fragment('<math>hello! <script>alert(0)</script></math>')
+      _(Sanitize.fragment('<math>hello! <script>alert(0)</script></math>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `noembed` elements' do
-      Sanitize.fragment('<noembed>hello! <script>alert(0)</script></noembed>')
+      _(Sanitize.fragment('<noembed>hello! <script>alert(0)</script></noembed>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `noframes` elements' do
-      Sanitize.fragment('<noframes>hello! <script>alert(0)</script></noframes>')
+      _(Sanitize.fragment('<noframes>hello! <script>alert(0)</script></noframes>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `noscript` elements' do
-      Sanitize.fragment('<noscript>hello! <script>alert(0)</script></noscript>')
+      _(Sanitize.fragment('<noscript>hello! <script>alert(0)</script></noscript>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `plaintext` elements' do
-      Sanitize.fragment('<plaintext>hello! <script>alert(0)</script>')
+      _(Sanitize.fragment('<plaintext>hello! <script>alert(0)</script>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `script` elements' do
-      Sanitize.fragment('<script>hello! <script>alert(0)</script></script>')
+      _(Sanitize.fragment('<script>hello! <script>alert(0)</script></script>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `style` elements' do
-      Sanitize.fragment('<style>hello! <script>alert(0)</script></style>')
+      _(Sanitize.fragment('<style>hello! <script>alert(0)</script></style>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `svg` elements' do
-      Sanitize.fragment('<svg>hello! <script>alert(0)</script></svg>')
+      _(Sanitize.fragment('<svg>hello! <script>alert(0)</script></svg>'))
         .must_equal ''
     end
 
     it 'should not preserve the content of removed `xmp` elements' do
-      Sanitize.fragment('<xmp>hello! <script>alert(0)</script></xmp>')
+      _(Sanitize.fragment('<xmp>hello! <script>alert(0)</script></xmp>'))
         .must_equal ''
     end
 
     strings.each do |name, data|
       it "should clean #{name} HTML" do
-        Sanitize.fragment(data[:html]).must_equal(data[:default])
+        _(Sanitize.fragment(data[:html])).must_equal(data[:default])
       end
     end
 
     protocols.each do |name, data|
       it "should not allow #{name}" do
-        Sanitize.fragment(data[:html]).must_equal(data[:default])
+        _(Sanitize.fragment(data[:html])).must_equal(data[:default])
       end
     end
   end
@@ -262,13 +262,13 @@ describe 'Sanitize::Transformers::CleanElement' do
 
     strings.each do |name, data|
       it "should clean #{name} HTML" do
-        @s.fragment(data[:html]).must_equal(data[:restricted])
+        _(@s.fragment(data[:html])).must_equal(data[:restricted])
       end
     end
 
     protocols.each do |name, data|
       it "should not allow #{name}" do
-        @s.fragment(data[:html]).must_equal(data[:restricted])
+        _(@s.fragment(data[:html])).must_equal(data[:restricted])
       end
     end
   end
@@ -279,24 +279,24 @@ describe 'Sanitize::Transformers::CleanElement' do
     end
 
     it 'should not choke on valueless attributes' do
-      @s.fragment('foo <a href>foo</a> bar')
+      _(@s.fragment('foo <a href>foo</a> bar'))
         .must_equal 'foo <a href="" rel="nofollow">foo</a> bar'
     end
 
     it 'should downcase attribute names' do
-      @s.fragment('<a HREF="javascript:alert(\'foo\')">bar</a>')
+      _(@s.fragment('<a HREF="javascript:alert(\'foo\')">bar</a>'))
         .must_equal '<a rel="nofollow">bar</a>'
     end
 
     strings.each do |name, data|
       it "should clean #{name} HTML" do
-        @s.fragment(data[:html]).must_equal(data[:basic])
+        _(@s.fragment(data[:html])).must_equal(data[:basic])
       end
     end
 
     protocols.each do |name, data|
       it "should not allow #{name}" do
-        @s.fragment(data[:html]).must_equal(data[:basic])
+        _(@s.fragment(data[:html])).must_equal(data[:basic])
       end
     end
   end
@@ -307,19 +307,19 @@ describe 'Sanitize::Transformers::CleanElement' do
     end
 
     it 'should encode special chars in attribute values' do
-      @s.fragment('<a href="http://example.com" title="<b>&eacute;xamples</b> & things">foo</a>')
+      _(@s.fragment('<a href="http://example.com" title="<b>&eacute;xamples</b> & things">foo</a>'))
         .must_equal '<a href="http://example.com" title="<b>éxamples</b> &amp; things">foo</a>'
     end
 
     strings.each do |name, data|
       it "should clean #{name} HTML" do
-        @s.fragment(data[:html]).must_equal(data[:relaxed])
+        _(@s.fragment(data[:html])).must_equal(data[:relaxed])
       end
     end
 
     protocols.each do |name, data|
       it "should not allow #{name}" do
-        @s.fragment(data[:html]).must_equal(data[:relaxed])
+        _(@s.fragment(data[:html])).must_equal(data[:relaxed])
       end
     end
   end
@@ -328,103 +328,103 @@ describe 'Sanitize::Transformers::CleanElement' do
     it 'should allow attributes on all elements if allowlisted under :all' do
       input = '<p class="foo">bar</p>'
 
-      Sanitize.fragment(input).must_equal ' bar '
+      _(Sanitize.fragment(input)).must_equal ' bar '
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['p'],
         :attributes => {:all => ['class']}
-      }).must_equal input
+      })).must_equal input
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['p'],
         :attributes => {'div' => ['class']}
-      }).must_equal '<p>bar</p>'
+      })).must_equal '<p>bar</p>'
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['p'],
         :attributes => {'p' => ['title'], :all => ['class']}
-      }).must_equal input
+      })).must_equal input
     end
 
     it "should not allow relative URLs when relative URLs aren't allowlisted" do
       input = '<a href="/foo/bar">Link</a>'
 
-      Sanitize.fragment(input,
+      _(Sanitize.fragment(input,
         :elements   => ['a'],
         :attributes => {'a' => ['href']},
         :protocols  => {'a' => {'href' => ['http']}}
-      ).must_equal '<a>Link</a>'
+      )).must_equal '<a>Link</a>'
     end
 
     it 'should allow relative URLs containing colons when the colon is not in the first path segment' do
       input = '<a href="/wiki/Special:Random">Random Page</a>'
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['a'],
         :attributes => {'a' => ['href']},
         :protocols  => {'a' => {'href' => [:relative]}}
-      }).must_equal input
+      })).must_equal input
     end
 
     it 'should allow relative URLs containing colons when the colon is part of an anchor' do
       input = '<a href="#fn:1">Footnote 1</a>'
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['a'],
         :attributes => {'a' => ['href']},
         :protocols  => {'a' => {'href' => [:relative]}}
-      }).must_equal input
+      })).must_equal input
 
       input = '<a href="somepage#fn:1">Footnote 1</a>'
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['a'],
         :attributes => {'a' => ['href']},
         :protocols  => {'a' => {'href' => [:relative]}}
-      }).must_equal input
+      })).must_equal input
     end
 
     it 'should remove the contents of filtered nodes when :remove_contents is true' do
-      Sanitize.fragment('foo bar <div>baz<span>quux</span></div>',
+      _(Sanitize.fragment('foo bar <div>baz<span>quux</span></div>',
         :remove_contents => true
-      ).must_equal 'foo bar   '
+      )).must_equal 'foo bar   '
     end
 
     it 'should remove the contents of specified nodes when :remove_contents is an Array or Set of element names as strings' do
-      Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
+      _(Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
         :remove_contents => ['script', 'span']
-      ).must_equal 'foo bar  baz hi '
+      )).must_equal 'foo bar  baz hi '
 
-      Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
+      _(Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
         :remove_contents => Set.new(['script', 'span'])
-      ).must_equal 'foo bar  baz hi '
+      )).must_equal 'foo bar  baz hi '
     end
 
     it 'should remove the contents of specified nodes when :remove_contents is an Array or Set of element names as symbols' do
-      Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
+      _(Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
         :remove_contents => [:script, :span]
-      ).must_equal 'foo bar  baz hi '
+      )).must_equal 'foo bar  baz hi '
 
-      Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
+      _(Sanitize.fragment('foo bar <div>baz<span>quux</span> <b>hi</b><script>alert("hello!");</script></div>',
         :remove_contents => Set.new([:script, :span])
-      ).must_equal 'foo bar  baz hi '
+      )).must_equal 'foo bar  baz hi '
     end
 
     it 'should remove the contents of allowlisted iframes' do
-      Sanitize.fragment('<iframe>hi <script>hello</script></iframe>',
+      _(Sanitize.fragment('<iframe>hi <script>hello</script></iframe>',
         :elements => ['iframe']
-      ).must_equal '<iframe></iframe>'
+      )).must_equal '<iframe></iframe>'
     end
 
     it 'should not allow arbitrary HTML5 data attributes by default' do
-      Sanitize.fragment('<b data-foo="bar"></b>',
+      _(Sanitize.fragment('<b data-foo="bar"></b>',
         :elements => ['b']
-      ).must_equal '<b></b>'
+      )).must_equal '<b></b>'
 
-      Sanitize.fragment('<b class="foo" data-foo="bar"></b>',
+      _(Sanitize.fragment('<b class="foo" data-foo="bar"></b>',
         :attributes => {'b' => ['class']},
         :elements   => ['b']
-      ).must_equal '<b class="foo"></b>'
+      )).must_equal '<b class="foo"></b>'
     end
 
     it 'should allow arbitrary HTML5 data attributes when the :attributes config includes :data' do
@@ -433,28 +433,28 @@ describe 'Sanitize::Transformers::CleanElement' do
         :elements   => ['b']
       )
 
-      s.fragment('<b data-foo="valid" data-bar="valid"></b>')
+      _(s.fragment('<b data-foo="valid" data-bar="valid"></b>'))
         .must_equal '<b data-foo="valid" data-bar="valid"></b>'
 
-      s.fragment('<b data-="invalid"></b>')
+      _(s.fragment('<b data-="invalid"></b>'))
         .must_equal '<b></b>'
 
-      s.fragment('<b data-="invalid"></b>')
+      _(s.fragment('<b data-="invalid"></b>'))
         .must_equal '<b></b>'
 
-      s.fragment('<b data-xml="invalid"></b>')
+      _(s.fragment('<b data-xml="invalid"></b>'))
         .must_equal '<b></b>'
 
-      s.fragment('<b data-xmlfoo="invalid"></b>')
+      _(s.fragment('<b data-xmlfoo="invalid"></b>'))
         .must_equal '<b></b>'
 
-      s.fragment('<b data-f:oo="valid"></b>')
+      _(s.fragment('<b data-f:oo="valid"></b>'))
         .must_equal '<b></b>'
 
-      s.fragment('<b data-f/oo="partial"></b>')
+      _(s.fragment('<b data-f/oo="partial"></b>'))
         .must_equal '<b data-f=""></b>' # Nokogiri quirk; not ideal, but harmless
 
-      s.fragment('<b data-éfoo="valid"></b>')
+      _(s.fragment('<b data-éfoo="valid"></b>'))
         .must_equal '<b></b>' # Another annoying Nokogiri quirk.
     end
 
@@ -467,78 +467,78 @@ describe 'Sanitize::Transformers::CleanElement' do
         }
       )
 
-      s.fragment('<p>foo</p>').must_equal "\nfoo\n"
-      s.fragment('<p>foo</p><p>bar</p>').must_equal "\nfoo\n\nbar\n"
-      s.fragment('foo<div>bar</div>baz').must_equal "foo\nbar\nbaz"
-      s.fragment('foo<br>bar<br>baz').must_equal "foo\nbar\nbaz"
+      _(s.fragment('<p>foo</p>')).must_equal "\nfoo\n"
+      _(s.fragment('<p>foo</p><p>bar</p>')).must_equal "\nfoo\n\nbar\n"
+      _(s.fragment('foo<div>bar</div>baz')).must_equal "foo\nbar\nbaz"
+      _(s.fragment('foo<br>bar<br>baz')).must_equal "foo\nbar\nbaz"
     end
 
     it 'should handle protocols correctly regardless of case' do
       input = '<a href="hTTpS://foo.com/">Text</a>'
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['a'],
         :attributes => {'a' => ['href']},
         :protocols  => {'a' => {'href' => ['https']}}
-      }).must_equal input
+      })).must_equal input
 
       input = '<a href="mailto:someone@example.com?Subject=Hello">Text</a>'
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements   => ['a'],
         :attributes => {'a' => ['href']},
         :protocols  => {'a' => {'href' => ['https']}}
-      }).must_equal "<a>Text</a>"
+      })).must_equal "<a>Text</a>"
     end
 
     it 'should sanitize protocols in data attributes even if data attributes are generically allowed' do
       input = '<a data-url="mailto:someone@example.com">Text</a>'
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements => ['a'],
         :attributes => {'a' => [:data]},
         :protocols => {'a' => {'data-url' => ['https']}}
-      }).must_equal "<a>Text</a>"
+      })).must_equal "<a>Text</a>"
 
-      Sanitize.fragment(input, {
+      _(Sanitize.fragment(input, {
         :elements => ['a'],
         :attributes => {'a' => [:data]},
         :protocols => {'a' => {'data-url' => ['mailto']}}
-      }).must_equal input
+      })).must_equal input
     end
 
     it 'should prevent `<meta>` tags from being used to set a non-UTF-8 charset' do
-      Sanitize.document('<html><head><meta charset="utf-8"></head><body>Howdy!</body></html>',
+      _(Sanitize.document('<html><head><meta charset="utf-8"></head><body>Howdy!</body></html>',
         :elements   => %w[html head meta body],
         :attributes => {'meta' => ['charset']}
-      ).must_equal "<html><head><meta charset=\"utf-8\"></head><body>Howdy!</body></html>"
+      )).must_equal "<html><head><meta charset=\"utf-8\"></head><body>Howdy!</body></html>"
 
-      Sanitize.document('<html><meta charset="utf-8">Howdy!</html>',
+      _(Sanitize.document('<html><meta charset="utf-8">Howdy!</html>',
         :elements   => %w[html meta],
         :attributes => {'meta' => ['charset']}
-      ).must_equal "<html><meta charset=\"utf-8\">Howdy!</html>"
+      )).must_equal "<html><meta charset=\"utf-8\">Howdy!</html>"
 
-      Sanitize.document('<html><meta charset="us-ascii">Howdy!</html>',
+      _(Sanitize.document('<html><meta charset="us-ascii">Howdy!</html>',
         :elements   => %w[html meta],
         :attributes => {'meta' => ['charset']}
-      ).must_equal "<html><meta charset=\"utf-8\">Howdy!</html>"
+      )).must_equal "<html><meta charset=\"utf-8\">Howdy!</html>"
 
-      Sanitize.document('<html><meta http-equiv="content-type" content=" text/html; charset=us-ascii">Howdy!</html>',
+      _(Sanitize.document('<html><meta http-equiv="content-type" content=" text/html; charset=us-ascii">Howdy!</html>',
         :elements   => %w[html meta],
         :attributes => {'meta' => %w[content http-equiv]}
-      ).must_equal "<html><meta http-equiv=\"content-type\" content=\" text/html;charset=utf-8\">Howdy!</html>"
+      )).must_equal "<html><meta http-equiv=\"content-type\" content=\" text/html;charset=utf-8\">Howdy!</html>"
 
-      Sanitize.document('<html><meta http-equiv="Content-Type" content="text/plain;charset = us-ascii">Howdy!</html>',
+      _(Sanitize.document('<html><meta http-equiv="Content-Type" content="text/plain;charset = us-ascii">Howdy!</html>',
         :elements   => %w[html meta],
         :attributes => {'meta' => %w[content http-equiv]}
-      ).must_equal "<html><meta http-equiv=\"Content-Type\" content=\"text/plain;charset=utf-8\">Howdy!</html>"
+      )).must_equal "<html><meta http-equiv=\"Content-Type\" content=\"text/plain;charset=utf-8\">Howdy!</html>"
     end
 
     it 'should not modify `<meta>` tags that already set a UTF-8 charset' do
-      Sanitize.document('<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"></head><body>Howdy!</body></html>',
+      _(Sanitize.document('<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"></head><body>Howdy!</body></html>',
         :elements   => %w[html head meta body],
         :attributes => {'meta' => %w[content http-equiv]}
-      ).must_equal "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"></head><body>Howdy!</body></html>"
+      )).must_equal "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"></head><body>Howdy!</body></html>"
     end
 
   end
diff --git a/test/test_config.rb b/test/test_config.rb
index d3a81e31917b..33e7c7166da2 100644
--- a/test/test_config.rb
+++ b/test/test_config.rb
@@ -6,7 +6,7 @@ describe 'Config' do
   parallelize_me!
 
   def verify_deeply_frozen(config)
-    config.must_be :frozen?
+    _(config).must_be :frozen?
 
     if Hash === config
       config.each_value {|v| verify_deeply_frozen(v) }
@@ -27,7 +27,7 @@ describe 'Config' do
       a = {:one => {:one_one => [0, '1', :a], :one_two => false, :one_three => Set.new([:a, :b, :c])}}
       b = Sanitize::Config.freeze_config(a)
 
-      b.must_be_same_as a
+      _(b).must_be_same_as a
       verify_deeply_frozen a
     end
   end
@@ -40,10 +40,10 @@ describe 'Config' do
 
       c = Sanitize::Config.merge(a, b)
 
-      c.wont_be_same_as a
-      c.wont_be_same_as b
+      _(c).wont_be_same_as a
+      _(c).wont_be_same_as b
 
-      c.must_equal(
+      _(c).must_equal(
         :one => {
           :one_one   => [0, '1', :a],
           :one_two   => true,
@@ -53,13 +53,13 @@ describe 'Config' do
         :two => 2
       )
 
-      c[:one].wont_be_same_as a[:one]
-      c[:one][:one_one].wont_be_same_as a[:one][:one_one]
+      _(c[:one]).wont_be_same_as a[:one]
+      _(c[:one][:one_one]).wont_be_same_as a[:one][:one_one]
     end
 
     it 'should raise an ArgumentError if either argument is not a Hash' do
-      proc { Sanitize::Config.merge('foo', {}) }.must_raise ArgumentError
-      proc { Sanitize::Config.merge({}, 'foo') }.must_raise ArgumentError
+      _(proc { Sanitize::Config.merge('foo', {}) }).must_raise ArgumentError
+      _(proc { Sanitize::Config.merge({}, 'foo') }).must_raise ArgumentError
     end
   end
 end
diff --git a/test/test_malicious_css.rb b/test/test_malicious_css.rb
index a7cc75979165..52c9539992f0 100644
--- a/test/test_malicious_css.rb
+++ b/test/test_malicious_css.rb
@@ -16,27 +16,27 @@ describe 'Malicious CSS' do
   end
 
   it 'should not be possible to inject an expression by munging it with a comment' do
-    @s.properties(%[width:expr/*XSS*/ession(alert('XSS'))]).
+    _(@s.properties(%[width:expr/*XSS*/ession(alert('XSS'))])).
       must_equal ''
 
-    @s.properties(%[width:ex/*XSS*//*/*/pression(alert("XSS"))]).
+    _(@s.properties(%[width:ex/*XSS*//*/*/pression(alert("XSS"))])).
       must_equal ''
   end
 
   it 'should not be possible to inject an expression by munging it with a newline' do
-    @s.properties(%[width:\nexpression(alert('XSS'));]).
+    _(@s.properties(%[width:\nexpression(alert('XSS'));])).
       must_equal ''
   end
 
   it 'should not allow the javascript protocol' do
-    @s.properties(%[background-image:url("javascript:alert('XSS')");]).
+    _(@s.properties(%[background-image:url("javascript:alert('XSS')");])).
       must_equal ''
 
-    Sanitize.fragment(%[<div style="background-image: url(&#1;javascript:alert('XSS'))">],
-      Sanitize::Config::RELAXED).must_equal '<div></div>'
+    _(Sanitize.fragment(%[<div style="background-image: url(&#1;javascript:alert('XSS'))">],
+      Sanitize::Config::RELAXED)).must_equal '<div></div>'
   end
 
   it 'should not allow behaviors' do
-    @s.properties(%[behavior: url(xss.htc);]).must_equal ''
+    _(@s.properties(%[behavior: url(xss.htc);])).must_equal ''
   end
 end
diff --git a/test/test_malicious_html.rb b/test/test_malicious_html.rb
index 39163b9926d6..d0fc57bbc2ad 100644
--- a/test/test_malicious_html.rb
+++ b/test/test_malicious_html.rb
@@ -17,111 +17,111 @@ describe 'Malicious HTML' do
 
   describe 'comments' do
     it 'should not allow script injection via conditional comments' do
-      @s.fragment(%[<!--[if gte IE 4]>\n<script>alert('XSS');</script>\n<![endif]-->]).
+      _(@s.fragment(%[<!--[if gte IE 4]>\n<script>alert('XSS');</script>\n<![endif]-->])).
         must_equal ''
     end
   end
 
   describe 'interpolation (ERB, PHP, etc.)' do
     it 'should escape ERB-style tags' do
-      @s.fragment('<% naughty_ruby_code %>').
+      _(@s.fragment('<% naughty_ruby_code %>')).
         must_equal '&lt;% naughty_ruby_code %&gt;'
 
-      @s.fragment('<%= naughty_ruby_code %>').
+      _(@s.fragment('<%= naughty_ruby_code %>')).
         must_equal '&lt;%= naughty_ruby_code %&gt;'
     end
 
     it 'should remove PHP-style tags' do
-      @s.fragment('<? naughtyPHPCode(); ?>').
+      _(@s.fragment('<? naughtyPHPCode(); ?>')).
         must_equal ''
 
-      @s.fragment('<?= naughtyPHPCode(); ?>').
+      _(@s.fragment('<?= naughtyPHPCode(); ?>')).
         must_equal ''
     end
   end
 
   describe '<body>' do
     it 'should not be possible to inject JS via a malformed event attribute' do
-      @s.document('<html><head></head><body onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert("XSS")></body></html>').
+      _(@s.document('<html><head></head><body onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert("XSS")></body></html>')).
         must_equal "<html><head></head><body></body></html>"
     end
   end
 
   describe '<iframe>' do
     it 'should not be possible to inject an iframe using an improperly closed tag' do
-      @s.fragment(%[<iframe src=http://ha.ckers.org/scriptlet.html <]).
+      _(@s.fragment(%[<iframe src=http://ha.ckers.org/scriptlet.html <])).
         must_equal ''
     end
   end
 
   describe '<img>' do
     it 'should not be possible to inject JS via an unquoted <img> src attribute' do
-      @s.fragment("<img src=javascript:alert('XSS')>").must_equal '<img>'
+      _(@s.fragment("<img src=javascript:alert('XSS')>")).must_equal '<img>'
     end
 
     it 'should not be possible to inject JS using grave accents as <img> src delimiters' do
-      @s.fragment("<img src=`javascript:alert('XSS')`>").must_equal '<img>'
+      _(@s.fragment("<img src=`javascript:alert('XSS')`>")).must_equal '<img>'
     end
 
     it 'should not be possible to inject <script> via a malformed <img> tag' do
-      @s.fragment('<img """><script>alert("XSS")</script>">').
+      _(@s.fragment('<img """><script>alert("XSS")</script>">')).
         must_equal '<img>"&gt;'
     end
 
     it 'should not be possible to inject protocol-based JS' do
-      @s.fragment('<img src=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>').
+      _(@s.fragment('<img src=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;>')).
         must_equal '<img>'
 
-      @s.fragment('<img src=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>').
+      _(@s.fragment('<img src=&#0000106&#0000097&#0000118&#0000097&#0000115&#0000099&#0000114&#0000105&#0000112&#0000116&#0000058&#0000097&#0000108&#0000101&#0000114&#0000116&#0000040&#0000039&#0000088&#0000083&#0000083&#0000039&#0000041>')).
         must_equal '<img>'
 
-      @s.fragment('<img src=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>').
+      _(@s.fragment('<img src=&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29>')).
         must_equal '<img>'
 
       # Encoded tab character.
-      @s.fragment(%[<img src="jav&#x09;ascript:alert('XSS');">]).
+      _(@s.fragment(%[<img src="jav&#x09;ascript:alert('XSS');">])).
         must_equal '<img>'
 
       # Encoded newline.
-      @s.fragment(%[<img src="jav&#x0A;ascript:alert('XSS');">]).
+      _(@s.fragment(%[<img src="jav&#x0A;ascript:alert('XSS');">])).
         must_equal '<img>'
 
       # Encoded carriage return.
-      @s.fragment(%[<img src="jav&#x0D;ascript:alert('XSS');">]).
+      _(@s.fragment(%[<img src="jav&#x0D;ascript:alert('XSS');">])).
         must_equal '<img>'
 
       # Null byte.
-      @s.fragment(%[<img src=java\0script:alert("XSS")>]).
+      _(@s.fragment(%[<img src=java\0script:alert("XSS")>])).
         must_equal '<img>'
 
       # Spaces plus meta char.
-      @s.fragment(%[<img src=" &#14;  javascript:alert('XSS');">]).
+      _(@s.fragment(%[<img src=" &#14;  javascript:alert('XSS');">])).
         must_equal '<img>'
 
       # Mixed spaces and tabs.
-      @s.fragment(%[<img src="j\na v\tascript://alert('XSS');">]).
+      _(@s.fragment(%[<img src="j\na v\tascript://alert('XSS');">])).
         must_equal '<img>'
     end
 
     it 'should not be possible to inject protocol-based JS via whitespace' do
-      @s.fragment(%[<img src="jav\tascript:alert('XSS');">]).
+      _(@s.fragment(%[<img src="jav\tascript:alert('XSS');">])).
         must_equal '<img>'
     end
 
     it 'should not be possible to inject JS using a half-open <img> tag' do
-      @s.fragment(%[<img src="javascript:alert('XSS')"]).
+      _(@s.fragment(%[<img src="javascript:alert('XSS')"])).
         must_equal ''
     end
   end
 
   describe '<script>' do
     it 'should not be possible to inject <script> using a malformed non-alphanumeric tag name' do
-      @s.fragment(%[<script/xss src="http://ha.ckers.org/xss.js">alert(1)</script>]).
+      _(@s.fragment(%[<script/xss src="http://ha.ckers.org/xss.js">alert(1)</script>])).
         must_equal ''
     end
 
     it 'should not be possible to inject <script> via extraneous open brackets' do
-      @s.fragment(%[<<script>alert("XSS");//<</script>]).
+      _(@s.fragment(%[<<script>alert("XSS");//<</script>])).
         must_equal '&lt;'
     end
   end
@@ -172,7 +172,7 @@ describe 'Malicious HTML' do
 
           # This uses Nokogumbo's HTML-compliant serializer rather than
           # libxml2's.
-          @s.fragment(input).
+          _(@s.fragment(input)).
             must_equal(%[<#{tag_name} #{attr_name}="examp<!--%22%20onmouseover=alert(1)>-->le.com">foo</#{tag_name}>])
 
           # This uses the not-quite-standards-compliant libxml2 serializer via
@@ -181,13 +181,13 @@ describe 'Malicious HTML' do
           # https://github.com/sparklemotion/nokogiri/commit/4852e43cb6039e26d8c51af78621e539cbf46c5d
           fragment = Nokogiri::HTML.fragment(input)
           @s.node!(fragment)
-          fragment.to_html.
+          _(fragment.to_html).
             must_equal(%[<#{tag_name} #{attr_name}="examp&lt;!--%22%20onmouseover=alert(1)&gt;--&gt;le.com">foo</#{tag_name}>])
         end
 
         it 'should round-trip to the same output' do
           output = @s.fragment(input)
-          @s.fragment(output).must_equal(output)
+          _(@s.fragment(output)).must_equal(output)
         end
       end
 
@@ -199,7 +199,7 @@ describe 'Malicious HTML' do
 
           # This uses Nokogumbo's HTML-compliant serializer rather than
           # libxml2's.
-          @s.fragment(input).
+          _(@s.fragment(input)).
             must_equal(%[<#{tag_name} #{attr_name}="examp<!--&quot; onmouseover=alert(1)>-->le.com">foo</#{tag_name}>])
 
           # This uses the not-quite-standards-compliant libxml2 serializer via
@@ -208,13 +208,13 @@ describe 'Malicious HTML' do
           # https://github.com/sparklemotion/nokogiri/commit/4852e43cb6039e26d8c51af78621e539cbf46c5d
           fragment = Nokogiri::HTML.fragment(input)
           @s.node!(fragment)
-          fragment.to_html.
+          _(fragment.to_html).
             must_equal(%[<#{tag_name} #{attr_name}='examp&lt;!--" onmouseover=alert(1)&gt;--&gt;le.com'>foo</#{tag_name}>])
         end
 
         it 'should round-trip to the same output' do
           output = @s.fragment(input)
-          @s.fragment(output).must_equal(output)
+          _(@s.fragment(output)).must_equal(output)
         end
       end
     end
@@ -224,10 +224,10 @@ describe 'Malicious HTML' do
   describe 'foreign content bypass in relaxed config' do
     it 'prevents a sanitization bypass via carefully crafted foreign content' do
       %w[iframe noembed noframes noscript plaintext script style xmp].each do |tag_name|
-        @s.fragment(%[<math><#{tag_name}>/*&lt;/#{tag_name}&gt;&lt;img src onerror=alert(1)>*/]).
+        _(@s.fragment(%[<math><#{tag_name}>/*&lt;/#{tag_name}&gt;&lt;img src onerror=alert(1)>*/])).
           must_equal ''
 
-        @s.fragment(%[<svg><#{tag_name}>/*&lt;/#{tag_name}&gt;&lt;img src onerror=alert(1)>*/]).
+        _(@s.fragment(%[<svg><#{tag_name}>/*&lt;/#{tag_name}&gt;&lt;img src onerror=alert(1)>*/])).
           must_equal ''
       end
     end
diff --git a/test/test_parser.rb b/test/test_parser.rb
index c22e38602222..dd68275ede98 100644
--- a/test/test_parser.rb
+++ b/test/test_parser.rb
@@ -6,26 +6,26 @@ describe 'Parser' do
   parallelize_me!
 
   it 'should translate valid entities into characters' do
-    Sanitize.fragment("&apos;&eacute;&amp;").must_equal("'é&amp;")
+    _(Sanitize.fragment("&apos;&eacute;&amp;")).must_equal("'é&amp;")
   end
 
   it 'should translate orphaned ampersands into entities' do
-    Sanitize.fragment('at&t').must_equal('at&amp;t')
+    _(Sanitize.fragment('at&t')).must_equal('at&amp;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 &gt; 2 and 2 &lt; 1'
-    Sanitize.fragment('OMG HAPPY BIRTHDAY! *<:-D').must_equal 'OMG HAPPY BIRTHDAY! *&lt;:-D'
+    _(Sanitize.fragment('1 > 2 and 2 < 1')).must_equal '1 &gt; 2 and 2 &lt; 1'
+    _(Sanitize.fragment('OMG HAPPY BIRTHDAY! *<:-D')).must_equal 'OMG HAPPY BIRTHDAY! *&lt;:-D'
   end
 
   describe 'when siblings are added after a node during traversal' do
@@ -59,7 +59,7 @@ describe 'Parser' do
       })
 
       # 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",
diff --git a/test/test_sanitize.rb b/test/test_sanitize.rb
index 2f7c72d63aa5..d9b2789aacde 100644
--- a/test/test_sanitize.rb
+++ b/test/test_sanitize.rb
@@ -9,7 +9,7 @@ describe 'Sanitize' do
       ]
 
       Sanitize.new({ :transformers => transformers })
-      transformers.length.must_equal(1)
+      _(transformers.length).must_equal(1)
     end
   end
 
@@ -24,33 +24,33 @@ describe 'Sanitize' do
       end
 
       it 'should sanitize an HTML document' do
-        @s.document('<!doctype html><html><b>Lo<!-- comment -->rem</b> <a href="pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <script>alert("hello world");</script></html>')
+        _(@s.document('<!doctype html><html><b>Lo<!-- comment -->rem</b> <a href="pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <script>alert("hello world");</script></html>'))
           .must_equal "<html>Lorem ipsum dolor sit amet </html>"
       end
 
       it 'should not modify the input string' do
         input = '<!DOCTYPE html><b>foo</b>'
         @s.document(input)
-        input.must_equal('<!DOCTYPE html><b>foo</b>')
+        _(input).must_equal('<!DOCTYPE html><b>foo</b>')
       end
 
       it 'should not choke on frozen documents' do
-        @s.document('<!doctype html><html><b>foo</b>'.freeze).must_equal "<html>foo</html>"
+        _(@s.document('<!doctype html><html><b>foo</b>'.freeze)).must_equal "<html>foo</html>"
       end
 
       it 'should normalize newlines' do
-        @s.document("a\r\n\n\r\r\r\nz").must_equal "<html>a\n\n\n\n\nz</html>"
+        _(@s.document("a\r\n\n\r\r\r\nz")).must_equal "<html>a\n\n\n\n\nz</html>"
       end
 
       it 'should strip control characters (except ASCII whitespace)' do
         sample_control_chars = "\u0001\u0008\u000b\u000e\u001f\u007f\u009f"
         whitespace = "\t\n\f\u0020"
-        @s.document("a#{sample_control_chars}#{whitespace}z").must_equal "<html>a#{whitespace}z</html>"
+        _(@s.document("a#{sample_control_chars}#{whitespace}z")).must_equal "<html>a#{whitespace}z</html>"
       end
 
       it 'should strip non-characters' do
         sample_non_chars = "\ufdd0\ufdef\ufffe\uffff\u{1fffe}\u{1ffff}\u{2fffe}\u{2ffff}\u{3fffe}\u{3ffff}\u{4fffe}\u{4ffff}\u{5fffe}\u{5ffff}\u{6fffe}\u{6ffff}\u{7fffe}\u{7ffff}\u{8fffe}\u{8ffff}\u{9fffe}\u{9ffff}\u{afffe}\u{affff}\u{bfffe}\u{bffff}\u{cfffe}\u{cffff}\u{dfffe}\u{dffff}\u{efffe}\u{effff}\u{ffffe}\u{fffff}\u{10fffe}\u{10ffff}"
-        @s.document("a#{sample_non_chars}z").must_equal "<html>az</html>"
+        _(@s.document("a#{sample_non_chars}z")).must_equal "<html>az</html>"
       end
 
       describe 'when html body exceeds Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH' do
@@ -71,7 +71,7 @@ describe 'Sanitize' do
           end
 
           it 'does not raise an ArgumentError exception' do
-            @s.document(content).must_equal '<html>foo</html>'
+            _(@s.document(content)).must_equal '<html>foo</html>'
           end
         end
       end
@@ -79,40 +79,40 @@ describe 'Sanitize' do
 
     describe '#fragment' do
       it 'should sanitize an HTML fragment' do
-        @s.fragment('<b>Lo<!-- comment -->rem</b> <a href="pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <script>alert("hello world");</script>')
+        _(@s.fragment('<b>Lo<!-- comment -->rem</b> <a href="pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <script>alert("hello world");</script>'))
           .must_equal 'Lorem ipsum dolor sit amet '
       end
 
       it 'should not modify the input string' do
         input = '<b>foo</b>'
         @s.fragment(input)
-        input.must_equal '<b>foo</b>'
+        _(input).must_equal '<b>foo</b>'
       end
 
       it 'should not choke on fragments containing <html> or <body>' do
-        @s.fragment('<html><b>foo</b></html>').must_equal 'foo'
-        @s.fragment('<body><b>foo</b></body>').must_equal 'foo'
-        @s.fragment('<html><body><b>foo</b></body></html>').must_equal 'foo'
-        @s.fragment('<!DOCTYPE html><html><body><b>foo</b></body></html>').must_equal 'foo'
+        _(@s.fragment('<html><b>foo</b></html>')).must_equal 'foo'
+        _(@s.fragment('<body><b>foo</b></body>')).must_equal 'foo'
+        _(@s.fragment('<html><body><b>foo</b></body></html>')).must_equal 'foo'
+        _(@s.fragment('<!DOCTYPE html><html><body><b>foo</b></body></html>')).must_equal 'foo'
       end
 
       it 'should not choke on frozen fragments' do
-        @s.fragment('<b>foo</b>'.freeze).must_equal 'foo'
+        _(@s.fragment('<b>foo</b>'.freeze)).must_equal 'foo'
       end
 
       it 'should normalize newlines' do
-        @s.fragment("a\r\n\n\r\r\r\nz").must_equal "a\n\n\n\n\nz"
+        _(@s.fragment("a\r\n\n\r\r\r\nz")).must_equal "a\n\n\n\n\nz"
       end
 
       it 'should strip control characters (except ASCII whitespace)' do
         sample_control_chars = "\u0001\u0008\u000b\u000e\u001f\u007f\u009f"
         whitespace = "\t\n\f\u0020"
-        @s.fragment("a#{sample_control_chars}#{whitespace}z").must_equal "a#{whitespace}z"
+        _(@s.fragment("a#{sample_control_chars}#{whitespace}z")).must_equal "a#{whitespace}z"
       end
 
       it 'should strip non-characters' do
         sample_non_chars = "\ufdd0\ufdef\ufffe\uffff\u{1fffe}\u{1ffff}\u{2fffe}\u{2ffff}\u{3fffe}\u{3ffff}\u{4fffe}\u{4ffff}\u{5fffe}\u{5ffff}\u{6fffe}\u{6ffff}\u{7fffe}\u{7ffff}\u{8fffe}\u{8ffff}\u{9fffe}\u{9ffff}\u{afffe}\u{affff}\u{bfffe}\u{bffff}\u{cfffe}\u{cffff}\u{dfffe}\u{dffff}\u{efffe}\u{effff}\u{ffffe}\u{fffff}\u{10fffe}\u{10ffff}"
-        @s.fragment("a#{sample_non_chars}z").must_equal "az"
+        _(@s.fragment("a#{sample_non_chars}z")).must_equal "az"
       end
 
       describe 'when html body exceeds Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH' do
@@ -133,7 +133,7 @@ describe 'Sanitize' do
           end
 
           it 'does not raise an ArgumentError exception' do
-            @s.fragment(content).must_equal 'foo'
+            _(@s.fragment(content)).must_equal 'foo'
           end
         end
       end
@@ -147,13 +147,13 @@ describe 'Sanitize' do
         doc.xpath('/html/body/node()').each {|node| frag << node }
 
         @s.node!(frag)
-        frag.to_html.must_equal 'Lorem ipsum dolor sit amet '
+        _(frag.to_html).must_equal 'Lorem ipsum dolor sit amet '
       end
 
       describe "when the given node is a document and <html> isn't allowlisted" do
         it 'should raise a Sanitize::Error' do
           doc = Nokogiri::HTML5.parse('foo')
-          proc { @s.node!(doc) }.must_raise Sanitize::Error
+          _(proc { @s.node!(doc) }).must_raise Sanitize::Error
         end
       end
     end
@@ -163,7 +163,7 @@ describe 'Sanitize' do
     describe '.document' do
       it 'should sanitize an HTML document with the given config' do
         html = '<!doctype html><html><b>Lo<!-- comment -->rem</b> <a href="pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <script>alert("hello world");</script></html>'
-        Sanitize.document(html, :elements => ['html'])
+        _(Sanitize.document(html, :elements => ['html']))
           .must_equal "<html>Lorem ipsum dolor sit amet </html>"
       end
     end
@@ -171,7 +171,7 @@ describe 'Sanitize' do
     describe '.fragment' do
       it 'should sanitize an HTML fragment with the given config' do
         html = '<b>Lo<!-- comment -->rem</b> <a href="pants" title="foo">ipsum</a> <a href="http://foo.com/"><strong>dolor</strong></a> sit<br/>amet <script>alert("hello world");</script>'
-        Sanitize.fragment(html, :elements => ['strong'])
+        _(Sanitize.fragment(html, :elements => ['strong']))
           .must_equal 'Lorem ipsum <strong>dolor</strong> sit amet '
       end
     end
@@ -184,7 +184,7 @@ describe 'Sanitize' do
         doc.xpath('/html/body/node()').each {|node| frag << node }
 
         Sanitize.node!(frag, :elements => ['strong'])
-        frag.to_html.must_equal 'Lorem ipsum <strong>dolor</strong> sit amet '
+        _(frag.to_html).must_equal 'Lorem ipsum <strong>dolor</strong> sit amet '
       end
     end
   end
diff --git a/test/test_sanitize_css.rb b/test/test_sanitize_css.rb
index 8e825c921f7f..185b6503f52c 100644
--- a/test/test_sanitize_css.rb
+++ b/test/test_sanitize_css.rb
@@ -16,9 +16,9 @@ describe 'Sanitize::CSS' do
       it 'should sanitize CSS properties' do
         css = 'background: #fff; width: expression(alert("hi"));'
 
-        @default.properties(css).must_equal ' '
-        @relaxed.properties(css).must_equal 'background: #fff; '
-        @custom.properties(css).must_equal 'background: #fff; '
+        _(@default.properties(css)).must_equal ' '
+        _(@relaxed.properties(css)).must_equal 'background: #fff; '
+        _(@custom.properties(css)).must_equal 'background: #fff; '
       end
 
       it 'should allow allowlisted URL protocols' do
@@ -30,9 +30,9 @@ describe 'Sanitize::CSS' do
           "background: url(https://example.com/https.jpg)",
           "background: url('https://example.com/https.jpg')",
         ].each do |css|
-          @default.properties(css).must_equal ''
-          @relaxed.properties(css).must_equal css
-          @custom.properties(css).must_equal ''
+          _(@default.properties(css)).must_equal ''
+          _(@relaxed.properties(css)).must_equal css
+          _(@custom.properties(css)).must_equal ''
         end
       end
 
@@ -46,18 +46,18 @@ describe 'Sanitize::CSS' do
           "background: url('javas\\\ncript:alert(0)')",
           "background: url('java\\0script:foo')"
         ].each do |css|
-          @default.properties(css).must_equal ''
-          @relaxed.properties(css).must_equal ''
-          @custom.properties(css).must_equal ''
+          _(@default.properties(css)).must_equal ''
+          _(@relaxed.properties(css)).must_equal ''
+          _(@custom.properties(css)).must_equal ''
         end
       end
 
       it 'should not allow -moz-binding' do
         css = "-moz-binding:url('http://ha.ckers.org/xssmoz.xml#xss')"
 
-        @default.properties(css).must_equal ''
-        @relaxed.properties(css).must_equal ''
-        @custom.properties(css).must_equal ''
+        _(@default.properties(css)).must_equal ''
+        _(@relaxed.properties(css)).must_equal ''
+        _(@custom.properties(css)).must_equal ''
       end
 
       it 'should not allow expressions' do
@@ -69,50 +69,50 @@ describe 'Sanitize::CSS' do
           "xss:expression(alert(1))",
           "height: foo(expression(alert(1)));"
         ].each do |css|
-          @default.properties(css).must_equal ''
-          @relaxed.properties(css).must_equal ''
-          @custom.properties(css).must_equal ''
+          _(@default.properties(css)).must_equal ''
+          _(@relaxed.properties(css)).must_equal ''
+          _(@custom.properties(css)).must_equal ''
         end
       end
 
       it 'should not allow behaviors' do
         css = "behavior: url(xss.htc);"
 
-        @default.properties(css).must_equal ''
-        @relaxed.properties(css).must_equal ''
-        @custom.properties(css).must_equal ''
+        _(@default.properties(css)).must_equal ''
+        _(@relaxed.properties(css)).must_equal ''
+        _(@custom.properties(css)).must_equal ''
       end
 
       describe 'when :allow_comments is true' do
         it 'should preserve comments' do
-          @relaxed.properties('color: #fff; /* comment */ width: 100px;')
+          _(@relaxed.properties('color: #fff; /* comment */ width: 100px;'))
             .must_equal 'color: #fff; /* comment */ width: 100px;'
 
-          @relaxed.properties("color: #fff; /* \n\ncomment */ width: 100px;")
+          _(@relaxed.properties("color: #fff; /* \n\ncomment */ width: 100px;"))
             .must_equal "color: #fff; /* \n\ncomment */ width: 100px;"
         end
       end
 
       describe 'when :allow_comments is false' do
         it 'should strip comments' do
-          @custom.properties('color: #fff; /* comment */ width: 100px;')
+          _(@custom.properties('color: #fff; /* comment */ width: 100px;'))
             .must_equal 'color: #fff;  width: 100px;'
 
-          @custom.properties("color: #fff; /* \n\ncomment */ width: 100px;")
+          _(@custom.properties("color: #fff; /* \n\ncomment */ width: 100px;"))
             .must_equal 'color: #fff;  width: 100px;'
         end
       end
 
       describe 'when :allow_hacks is true' do
         it 'should allow common CSS hacks' do
-          @relaxed.properties('_border: 1px solid #fff; *width: 10px')
+          _(@relaxed.properties('_border: 1px solid #fff; *width: 10px'))
             .must_equal '_border: 1px solid #fff; *width: 10px'
         end
       end
 
       describe 'when :allow_hacks is false' do
         it 'should not allow common CSS hacks' do
-          @custom.properties('_border: 1px solid #fff; *width: 10px')
+          _(@custom.properties('_border: 1px solid #fff; *width: 10px'))
             .must_equal ' '
         end
       end
@@ -131,14 +131,14 @@ describe 'Sanitize::CSS' do
           }
         ].strip
 
-        @default.stylesheet(css).strip.must_equal %[
+        _(@default.stylesheet(css).strip).must_equal %[
           .foo {  }
           #bar {  }
         ].strip
 
-        @relaxed.stylesheet(css).must_equal css
+        _(@relaxed.stylesheet(css)).must_equal css
 
-        @custom.stylesheet(css).strip.must_equal %[
+        _(@custom.stylesheet(css).strip).must_equal %[
           .foo { color: #fff; }
           #bar {  }
         ].strip
@@ -146,34 +146,34 @@ describe 'Sanitize::CSS' do
 
       describe 'when :allow_comments is true' do
         it 'should preserve comments' do
-          @relaxed.stylesheet('.foo { color: #fff; /* comment */ width: 100px; }')
+          _(@relaxed.stylesheet('.foo { color: #fff; /* comment */ width: 100px; }'))
             .must_equal '.foo { color: #fff; /* comment */ width: 100px; }'
 
-          @relaxed.stylesheet(".foo { color: #fff; /* \n\ncomment */ width: 100px; }")
+          _(@relaxed.stylesheet(".foo { color: #fff; /* \n\ncomment */ width: 100px; }"))
             .must_equal ".foo { color: #fff; /* \n\ncomment */ width: 100px; }"
         end
       end
 
       describe 'when :allow_comments is false' do
         it 'should strip comments' do
-          @custom.stylesheet('.foo { color: #fff; /* comment */ width: 100px; }')
+          _(@custom.stylesheet('.foo { color: #fff; /* comment */ width: 100px; }'))
             .must_equal '.foo { color: #fff;  width: 100px; }'
 
-          @custom.stylesheet(".foo { color: #fff; /* \n\ncomment */ width: 100px; }")
+          _(@custom.stylesheet(".foo { color: #fff; /* \n\ncomment */ width: 100px; }"))
             .must_equal '.foo { color: #fff;  width: 100px; }'
         end
       end
 
       describe 'when :allow_hacks is true' do
         it 'should allow common CSS hacks' do
-          @relaxed.stylesheet('.foo { _border: 1px solid #fff; *width: 10px }')
+          _(@relaxed.stylesheet('.foo { _border: 1px solid #fff; *width: 10px }'))
             .must_equal '.foo { _border: 1px solid #fff; *width: 10px }'
         end
       end
 
       describe 'when :allow_hacks is false' do
         it 'should not allow common CSS hacks' do
-          @custom.stylesheet('.foo { _border: 1px solid #fff; *width: 10px }')
+          _(@custom.stylesheet('.foo { _border: 1px solid #fff; *width: 10px }'))
             .must_equal '.foo {  }'
         end
       end
@@ -185,9 +185,9 @@ describe 'Sanitize::CSS' do
           ".foo { background: #fff; font: 16pt 'Comic Sans MS'; }\n" <<
           "#bar { top: 125px; background: green; }")
 
-        @custom.tree!(tree).must_be_same_as tree
+        _(@custom.tree!(tree)).must_be_same_as tree
 
-        Crass::Parser.stringify(tree).must_equal String.new("\n") <<
+        _(Crass::Parser.stringify(tree)).must_equal String.new("\n") <<
             ".foo { background: #fff;  }\n" <<
             "#bar {  background: green; }"
       end
@@ -199,9 +199,9 @@ describe 'Sanitize::CSS' do
       it 'should sanitize CSS properties with the given config' do
         css = 'background: #fff; width: expression(alert("hi"));'
 
-        Sanitize::CSS.properties(css).must_equal ' '
-        Sanitize::CSS.properties(css, Sanitize::Config::RELAXED[:css]).must_equal 'background: #fff; '
-        Sanitize::CSS.properties(css, :properties => %w[background color width]).must_equal 'background: #fff; '
+        _(Sanitize::CSS.properties(css)).must_equal ' '
+        _(Sanitize::CSS.properties(css, Sanitize::Config::RELAXED[:css])).must_equal 'background: #fff; '
+        _(Sanitize::CSS.properties(css, :properties => %w[background color width])).must_equal 'background: #fff; '
       end
     end
 
@@ -218,14 +218,14 @@ describe 'Sanitize::CSS' do
           }
         ].strip
 
-        Sanitize::CSS.stylesheet(css).strip.must_equal %[
+        _(Sanitize::CSS.stylesheet(css).strip).must_equal %[
           .foo {  }
           #bar {  }
         ].strip
 
-        Sanitize::CSS.stylesheet(css, Sanitize::Config::RELAXED[:css]).must_equal css
+        _(Sanitize::CSS.stylesheet(css, Sanitize::Config::RELAXED[:css])).must_equal css
 
-        Sanitize::CSS.stylesheet(css, :properties => %w[background color width]).strip.must_equal %[
+        _(Sanitize::CSS.stylesheet(css, :properties => %w[background color width]).strip).must_equal %[
           .foo { color: #fff; }
           #bar {  }
         ].strip
@@ -238,9 +238,9 @@ describe 'Sanitize::CSS' do
           ".foo { background: #fff; font: 16pt 'Comic Sans MS'; }\n" <<
           "#bar { top: 125px; background: green; }")
 
-        Sanitize::CSS.tree!(tree, :properties => %w[background color width]).must_be_same_as tree
+        _(Sanitize::CSS.tree!(tree, :properties => %w[background color width])).must_be_same_as tree
 
-        Crass::Parser.stringify(tree).must_equal String.new("\n") <<
+        _(Crass::Parser.stringify(tree)).must_equal String.new("\n") <<
             ".foo { background: #fff;  }\n" <<
             "#bar {  background: green; }"
       end
@@ -256,7 +256,7 @@ describe 'Sanitize::CSS' do
     # https://github.com/rgrove/sanitize/issues/121
     it 'should parse the contents of @media rules properly' do
       css = '@media { p[class="center"] { text-align: center; }}'
-      @relaxed.stylesheet(css).must_equal css
+      _(@relaxed.stylesheet(css)).must_equal css
 
       css = %[
         @media (max-width: 720px) {
@@ -269,7 +269,7 @@ describe 'Sanitize::CSS' do
         }
       ].strip
 
-      @relaxed.stylesheet(css).must_equal %[
+      _(@relaxed.stylesheet(css)).must_equal %[
         @media (max-width: 720px) {
           p.foo > .bar { float: right;  }
           #baz { color: green; }
@@ -303,7 +303,7 @@ describe 'Sanitize::CSS' do
         }
       ].strip
 
-      @relaxed.stylesheet(css).must_equal css
+      _(@relaxed.stylesheet(css)).must_equal css
     end
 
     describe ":at_rules" do
@@ -314,7 +314,7 @@ describe 'Sanitize::CSS' do
           .foo { color: green; }
         ].strip
 
-        @relaxed.stylesheet(css).strip.must_equal %[
+        _(@relaxed.stylesheet(css).strip).must_equal %[
           .foo { color: green; }
         ].strip
       end
@@ -333,7 +333,7 @@ describe 'Sanitize::CSS' do
             .foo { color: green; }
           ].strip
 
-          @scss.stylesheet(css).must_equal %[
+          _(@scss.stylesheet(css)).must_equal %[
             @charset 'utf-8';
             @import url('foo.css');
             .foo { color: green; }
@@ -347,7 +347,7 @@ describe 'Sanitize::CSS' do
             .foo { color: green; }
           ].strip
 
-          @scss.stylesheet(css).strip.must_equal %[
+          _(@scss.stylesheet(css).strip).must_equal %[
             .foo { color: green; }
           ].strip
         end
@@ -367,7 +367,7 @@ describe 'Sanitize::CSS' do
               @import url('https://somesite.com/something.css');
             ].strip
 
-            @scss.stylesheet(css).strip.must_equal %[
+            _(@scss.stylesheet(css).strip).must_equal %[
               @import url('https://somesite.com/something.css');
             ].strip
           end
@@ -388,7 +388,7 @@ describe 'Sanitize::CSS' do
               @import url('https://fonts.googleapis.com/css?family=Indie+Flower');
             ].strip
 
-            @scss.stylesheet(css).strip.must_equal %[
+            _(@scss.stylesheet(css).strip).must_equal %[
               @import 'https://fonts.googleapis.com/css?family=Indie+Flower';
               @import url('https://fonts.googleapis.com/css?family=Indie+Flower');
             ].strip
@@ -401,7 +401,7 @@ describe 'Sanitize::CSS' do
               @import url('https://nastysite.com/nasty_hax0r.css');
             ].strip
 
-            @scss.stylesheet(css).strip.must_equal %[
+            _(@scss.stylesheet(css).strip).must_equal %[
               @import 'https://fonts.googleapis.com/css?family=Indie+Flower';
             ].strip
           end
@@ -413,7 +413,7 @@ describe 'Sanitize::CSS' do
               @import url('');
             ].strip
 
-            @scss.stylesheet(css).strip.must_equal %[
+            _(@scss.stylesheet(css).strip).must_equal %[
               @import 'https://fonts.googleapis.com/css?family=Indie+Flower';
             ].strip
           end
diff --git a/test/test_transformers.rb b/test/test_transformers.rb
index 54ee2984ace6..580e340b067f 100644
--- a/test/test_transformers.rb
+++ b/test/test_transformers.rb
@@ -11,14 +11,14 @@ describe 'Transformers' do
       :transformers => lambda {|env|
         return unless env[:node].element?
 
-        env[:config][:foo].must_equal :bar
-        env[:is_allowlisted].must_equal false
-        env[:is_whitelisted].must_equal env[:is_allowlisted]
-        env[:node].must_be_kind_of Nokogiri::XML::Node
-        env[:node_name].must_equal 'span'
-        env[:node_allowlist].must_be_kind_of Set
-        env[:node_allowlist].must_be_empty
-        env[:node_whitelist].must_equal env[:node_allowlist]
+        _(env[:config][:foo]).must_equal :bar
+        _(env[:is_allowlisted]).must_equal false
+        _(env[:is_whitelisted]).must_equal env[:is_allowlisted]
+        _(env[:node]).must_be_kind_of Nokogiri::XML::Node
+        _(env[:node_name]).must_equal 'span'
+        _(env[:node_allowlist]).must_be_kind_of Set
+        _(env[:node_allowlist]).must_be_empty
+        _(env[:node_whitelist]).must_equal env[:node_allowlist]
       }
     )
   end
@@ -30,7 +30,7 @@ describe 'Transformers' do
       :transformers => proc {|env| nodes << env[:node_name] }
     )
 
-    nodes.must_equal %w[
+    _(nodes).must_equal %w[
       #document-fragment div text text text comment script text
     ]
   end
@@ -42,25 +42,25 @@ describe 'Transformers' do
       :transformers => proc {|env| nodes << env[:node_name] if env[:node].element? }
     )
 
-    nodes.must_equal %w[div span strong b p]
+    _(nodes).must_equal %w[div span strong b p]
   end
 
   it 'should allowlist nodes in the node allowlist' do
-    Sanitize.fragment('<div class="foo">foo</div><span>bar</span>',
+    _(Sanitize.fragment('<div class="foo">foo</div><span>bar</span>',
       :transformers => [
         proc {|env|
           {:node_allowlist => [env[:node]]} if env[:node_name] == 'div'
         },
 
         proc {|env|
-          env[:is_allowlisted].must_equal false unless env[:node_name] == 'div'
-          env[:is_allowlisted].must_equal true if env[:node_name] == 'div'
-          env[:node_allowlist].must_include env[:node] if env[:node_name] == 'div'
-          env[:is_whitelisted].must_equal env[:is_allowlisted]
-          env[:node_whitelist].must_equal env[:node_allowlist]
+          _(env[:is_allowlisted]).must_equal false unless env[:node_name] == 'div'
+          _(env[:is_allowlisted]).must_equal true if env[:node_name] == 'div'
+          _(env[:node_allowlist]).must_include env[:node] if env[:node_name] == 'div'
+          _(env[:is_whitelisted]).must_equal env[:is_allowlisted]
+          _(env[:node_whitelist]).must_equal env[:node_allowlist]
         }
       ]
-    ).must_equal '<div class="foo">foo</div>bar'
+    )).must_equal '<div class="foo">foo</div>bar'
   end
 
   it 'should clear the node allowlist after each fragment' do
@@ -73,19 +73,19 @@ describe 'Transformers' do
     Sanitize.fragment('<div>foo</div>',
       :transformers => proc {|env|
         called = true
-        env[:is_allowlisted].must_equal false
-        env[:is_whitelisted].must_equal env[:is_allowlisted]
-        env[:node_allowlist].must_be_empty
-        env[:node_whitelist].must_equal env[:node_allowlist]
+        _(env[:is_allowlisted]).must_equal false
+        _(env[:is_whitelisted]).must_equal env[:is_allowlisted]
+        _(env[:node_allowlist]).must_be_empty
+        _(env[:node_whitelist]).must_equal env[:node_allowlist]
       }
     )
 
-    called.must_equal true
+    _(called).must_equal true
   end
 
   it 'should accept a method transformer' do
     def transformer(env); end
-    Sanitize.fragment('<div>foo</div>', :transformers => method(:transformer))
+    _(Sanitize.fragment('<div>foo</div>', :transformers => method(:transformer)))
       .must_equal(' foo ')
   end
 
@@ -114,32 +114,32 @@ describe 'Transformers' do
 
     it 'should allow images with relative URLs' do
       input = '<img src="/foo/bar.jpg">'
-      @s.fragment(input).must_equal(input)
+      _(@s.fragment(input)).must_equal(input)
     end
 
     it 'should allow images at the example.com domain' do
       input = '<img src="http://example.com/foo/bar.jpg">'
-      @s.fragment(input).must_equal(input)
+      _(@s.fragment(input)).must_equal(input)
 
       input = '<img src="https://example.com/foo/bar.jpg">'
-      @s.fragment(input).must_equal(input)
+      _(@s.fragment(input)).must_equal(input)
 
       input = '<img src="//example.com/foo/bar.jpg">'
-      @s.fragment(input).must_equal(input)
+      _(@s.fragment(input)).must_equal(input)
     end
 
     it 'should not allow images at other domains' do
       input = '<img src="http://evil.com/foo/bar.jpg">'
-      @s.fragment(input).must_equal('')
+      _(@s.fragment(input)).must_equal('')
 
       input = '<img src="https://evil.com/foo/bar.jpg">'
-      @s.fragment(input).must_equal('')
+      _(@s.fragment(input)).must_equal('')
 
       input = '<img src="//evil.com/foo/bar.jpg">'
-      @s.fragment(input).must_equal('')
+      _(@s.fragment(input)).must_equal('')
 
       input = '<img src="http://subdomain.example.com/foo/bar.jpg">'
-      @s.fragment(input).must_equal('')
+      _(@s.fragment(input)).must_equal('')
     end
   end
 
@@ -177,35 +177,35 @@ describe 'Transformers' do
     it 'should allow HTTP YouTube video embeds' do
       input = '<iframe width="420" height="315" src="http://www.youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen bogus="bogus"><script>alert()</script></iframe>'
 
-      Sanitize.fragment(input, :transformers => youtube_transformer)
+      _(Sanitize.fragment(input, :transformers => youtube_transformer))
         .must_equal '<iframe width="420" height="315" src="http://www.youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen=""></iframe>'
     end
 
     it 'should allow HTTPS YouTube video embeds' do
       input = '<iframe width="420" height="315" src="https://www.youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen bogus="bogus"><script>alert()</script></iframe>'
 
-      Sanitize.fragment(input, :transformers => youtube_transformer)
+      _(Sanitize.fragment(input, :transformers => youtube_transformer))
         .must_equal '<iframe width="420" height="315" src="https://www.youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen=""></iframe>'
     end
 
     it 'should allow protocol-relative YouTube video embeds' do
       input = '<iframe width="420" height="315" src="//www.youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen bogus="bogus"><script>alert()</script></iframe>'
 
-      Sanitize.fragment(input, :transformers => youtube_transformer)
+      _(Sanitize.fragment(input, :transformers => youtube_transformer))
         .must_equal '<iframe width="420" height="315" src="//www.youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen=""></iframe>'
     end
 
     it 'should allow privacy-enhanced YouTube video embeds' do
       input = '<iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen bogus="bogus"><script>alert()</script></iframe>'
 
-      Sanitize.fragment(input, :transformers => youtube_transformer)
+      _(Sanitize.fragment(input, :transformers => youtube_transformer))
         .must_equal '<iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen=""></iframe>'
     end
 
     it 'should not allow non-YouTube video embeds' do
       input = '<iframe width="420" height="315" src="http://www.fake-youtube.com/embed/QH2-TGUlwu4" frameborder="0" allowfullscreen></iframe>'
 
-      Sanitize.fragment(input, :transformers => youtube_transformer)
+      _(Sanitize.fragment(input, :transformers => youtube_transformer))
         .must_equal('')
     end
   end
@@ -223,7 +223,7 @@ describe 'Transformers' do
     it 'should allow the <b> tag to be changed to a <strong> tag' do
       input = '<b>text</b>'
 
-      Sanitize.fragment(input, :elements => ['strong'], :transformers => b_to_strong_tag_transformer)
+      _(Sanitize.fragment(input, :elements => ['strong'], :transformers => b_to_strong_tag_transformer))
         .must_equal '<strong>text</strong>'
     end
   end
-- 
2.39.1