class RuboCop::Cop::RSpec::ExcessiveDocstringSpacing

def excessive_whitespace?(text)

Parameters:
  • text (String) --
def excessive_whitespace?(text)
  text.match?(/
    # Leading space
    \A[[:blank:]]
    |
    # Trailing space
    [[:blank:]]\z
    |
    # Two or more consecutive spaces, except if they are leading spaces
    [^[[:space:]]][[:blank:]]{2,}[^[[:blank:]]]
  /x)
end