78
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/lookout/equality.rb', line 78
def diff(expected, actual)
return unless String === actual
(expected.include? "\n" or actual.include? "\n") ?
Lookout::Diff::Formats::Unified.
new(Lookout::Diff::Groups.
new(Lookout::Diff::Operations.
new(Lookout::Diff::Algorithms::Difflib.
new(actual.split("\n"),
expected.split("\n"))))).to_a.join("\n") :
Lookout::Diff::Formats::Inline.
new(Lookout::Diff::Operations.
new(Lookout::Diff::Algorithms::Difflib.new(actual, expected))).to_s
end
|