Skip to content

Instantly share code, notes, and snippets.

@Sutto
Created March 10, 2011 06:20
Show Gist options
  • Save Sutto/863653 to your computer and use it in GitHub Desktop.
Save Sutto/863653 to your computer and use it in GitHub Desktop.
def diff(a, b, file = "current.diff")
require 'rspec/expectations/differ'
differ = RSpec::Expectations::Differ.new
diff = differ.diff_as_object(a, b)
File.open(file, "w+") { |f| f.write diff }
system "mate", file
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment