Skip to content

Instantly share code, notes, and snippets.

@j16r
Forked from Sutto/your-irbrc.rb
Created March 10, 2011 07:32
Show Gist options
  • Save j16r/863704 to your computer and use it in GitHub Desktop.
Save j16r/863704 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