From 3ca8a870d78e4e0adde8c5e27a695ca6670f14eb Mon Sep 17 00:00:00 2001 From: Juanito Fatas Date: Tue, 2 Apr 2019 13:55:44 +0900 Subject: [PATCH] Update test behavior for Nokogiri > 1.9.1. Skip some tests for Ruby 2.2 because Nokogiri behavior changed. --- test/sanitizer_test.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/sanitizer_test.rb b/test/sanitizer_test.rb index 7bcab6f..340565e 100644 --- a/test/sanitizer_test.rb +++ b/test/sanitizer_test.rb @@ -485,35 +485,43 @@ def test_allow_data_attribute_if_requested end def test_uri_escaping_of_href_attr_in_a_tag_in_white_list_sanitizer + skip if RUBY_VERSION < "2.3" + html = %{test} text = white_list_sanitize(html) - assert_equal %{test}, text + assert_equal %{test}, text end def test_uri_escaping_of_src_attr_in_a_tag_in_white_list_sanitizer + skip if RUBY_VERSION < "2.3" + html = %{test} text = white_list_sanitize(html) - assert_equal %{test}, text + assert_equal %{test}, text end def test_uri_escaping_of_name_attr_in_a_tag_in_white_list_sanitizer + skip if RUBY_VERSION < "2.3" + html = %{test} text = white_list_sanitize(html) - assert_equal %{test}, text + assert_equal %{test}, text end def test_uri_escaping_of_name_action_in_a_tag_in_white_list_sanitizer + skip if RUBY_VERSION < "2.3" + html = %{test} text = white_list_sanitize(html, attributes: ['action']) - assert_equal %{test}, text + assert_equal %{test}, text end protected