Skip to content

Commit f6df501

Browse files
JudahmeekAbanoubGhadban
authored andcommitted
ignore whitespace when comparing scripts
1 parent b24ee8a commit f6df501

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/dummy/spec/support/script_tag_utils.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
opts = {}
77
match do |actual|
88
Nokogiri::HTML.fragment(actual).css("script").map do |script|
9-
EquivalentXml.equivalent?(Nokogiri::HTML.fragment(script.to_s),
10-
Nokogiri::HTML.fragment(expected),
9+
EquivalentXml.equivalent?(Nokogiri::HTML.fragment(script.to_s.delete(" \t\r\n")),
10+
Nokogiri::HTML.fragment(expected.delete(" \t\r\n")),
1111
opts)
1212
end.include?(true)
1313
end

0 commit comments

Comments
 (0)