Module: Test::Diff

Defined in:
lib/test-unit-ext/diff.rb

Defined Under Namespace

Classes: Differ, ReadableDiffer, SequenceMatcher, UnifiedDiffer

Class Method Summary collapse

Class Method Details

.diff(differ_class, from, to, options = {}) ⇒ Object



474
475
476
477
# File 'lib/test-unit-ext/diff.rb', line 474

def diff(differ_class, from, to, options={})
  differ = differ_class.new(from.split(/\r?\n/), to.split(/\r?\n/))
  differ.diff(options).join("\n")
end

.readable(from, to, options = {}) ⇒ Object



466
467
468
# File 'lib/test-unit-ext/diff.rb', line 466

def readable(from, to, options={})
  diff(ReadableDiffer, from, to, options)
end

.unified(from, to, options = {}) ⇒ Object



470
471
472
# File 'lib/test-unit-ext/diff.rb', line 470

def unified(from, to, options={})
  diff(UnifiedDiffer, from, to, options)
end