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



486
487
488
489
# File 'lib/test-unit-ext/diff.rb', line 486

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



478
479
480
# File 'lib/test-unit-ext/diff.rb', line 478

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

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



482
483
484
# File 'lib/test-unit-ext/diff.rb', line 482

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