class Test::Unit::Diff::ReadableDiffer

Public Instance Methods

diff(options={}) click to toggle source
# File test-unit-3.5.3/lib/test/unit/diff.rb, line 413
def diff(options={})
  @result = []
  operations.each do |tag, from_start, from_end, to_start, to_end|
    case tag
    when :replace
      diff_lines(from_start, from_end, to_start, to_end)
    when :delete
      tag_deleted(@from[from_start...from_end])
    when :insert
      tag_inserted(@to[to_start...to_end])
    when :equal
      tag_equal(@from[from_start...from_end])
    else
      raise "unknown tag: #{tag}"
    end
  end
  @result
end