lib/capybara/node/whitespace_normalizer.rb in capybara-3.39.2 vs lib/capybara/node/whitespace_normalizer.rb in capybara-3.40.0
- old
+ new
@@ -14,20 +14,20 @@
NON_BREAKING_SPACE = "\u00a0"
LINE_SEPERATOR = "\u2028"
PARAGRAPH_SEPERATOR = "\u2029"
# All spaces except for NBSP
- BREAKING_SPACES = "[[:space:]&&[^#{NON_BREAKING_SPACE}]]"
+ BREAKING_SPACES = "[[:space:]&&[^#{NON_BREAKING_SPACE}]]".freeze
# Whitespace we want to substitute with plain spaces
- SQUEEZED_SPACES = " \n\f\t\v#{LINE_SEPERATOR}#{PARAGRAPH_SEPERATOR}"
+ SQUEEZED_SPACES = " \n\f\t\v#{LINE_SEPERATOR}#{PARAGRAPH_SEPERATOR}".freeze
# Any whitespace at the front of text
- LEADING_SPACES = /\A#{BREAKING_SPACES}+/.freeze
+ LEADING_SPACES = /\A#{BREAKING_SPACES}+/
# Any whitespace at the end of text
- TRAILING_SPACES = /#{BREAKING_SPACES}+\z/.freeze
+ TRAILING_SPACES = /#{BREAKING_SPACES}+\z/
# "Invisible" space character
ZERO_WIDTH_SPACE = "\u200b"
# Signifies text is read left to right
@@ -38,10 +38,10 @@
# Characters we want to truncate from text
REMOVED_CHARACTERS = [ZERO_WIDTH_SPACE, LEFT_TO_RIGHT_MARK, RIGHT_TO_LEFT_MARK].join
# Matches multiple empty lines
- EMPTY_LINES = /[\ \n]*\n[\ \n]*/.freeze
+ EMPTY_LINES = /[\ \n]*\n[\ \n]*/
##
#
# Normalizes the spacing of a node's text to be similar to
# what matchers might expect.