module RuboCop::Minitest::AssertOffense

def assert_no_corrections

def assert_no_corrections
  raise '`assert_no_corrections` must follow `assert_offense`' unless @processed_source
  return if @last_corrector.empty?
  # This is just here for a pretty diff if the source actually got changed
  new_source = @last_corrector.rewrite
  assert_equal(@processed_source.buffer.source, new_source)
  # There is an infinite loop if a corrector is present that did not make
  # any changes. It will cause the same offense/correction on the next loop.
  raise RuboCop::Runner::InfiniteCorrectionLoop.new(@processed_source.path, [@offenses])
end