require 'rubygems' $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'differ' RSpec.configure do |config| # config.order = 'random' # config.profile_examples = 3 end def diff(*parts) x = Differ::Diff.new x.instance_variable_set(:@raw, parts) return x end class String def +@ Differ::Change.new(:insert => self) end # this breaks rspec currently # undefined method `call' for nil:NilClass # def -@ # Differ::Change.new(:delete => self) # end def >>(to) Differ::Change.new(:delete => self, :insert => to) end end