class Sass::CSS

def assert_match(re)

Parameters:
  • re (Regexp) -- The regular expression to assert
def assert_match(re)
  if @template.scan(re)
    whitespace
    return
  end
  line = @template.string[0..@template.pos].count "\n"
  pos = @template.pos
  after = @template.string[pos - 15...pos]
  after = "..." + after if pos >= 15
  # Display basic regexps as plain old strings
  expected = re.source == Regexp.escape(re.source) ? "\"#{re.source}\"" : re.inspect
  was = @template.rest[0...15]
  was += "..." if @template.rest.size >= 15
  raise Exception.new(<<MESSAGE)
lid CSS on line #{line + 1} after #{after.inspect}:
pected #{expected}, was #{was.inspect}
AGE
end