Module: Test::Unit::Diff
- Defined in:
- lib/test/unit/diff.rb
Defined Under Namespace
Classes: Differ, ReadableDiffer, SequenceMatcher, UnifiedDiffer
Class Method Summary
collapse
Class Method Details
.diff(differ_class, from, to, options = {}) ⇒ Object
518
519
520
521
|
# File 'lib/test/unit/diff.rb', line 518
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
510
511
512
|
# File 'lib/test/unit/diff.rb', line 510
def readable(from, to, options={})
diff(ReadableDiffer, from, to, options)
end
|
.unified(from, to, options = {}) ⇒ Object
514
515
516
|
# File 'lib/test/unit/diff.rb', line 514
def unified(from, to, options={})
diff(UnifiedDiffer, from, to, options)
end
|