Permalink
Browse files

change to splitting directly on string

  • Loading branch information...
JonRowe committed Mar 14, 2013
1 parent 474bea3 commit da0ea8a58b3f229a126d1f24c9bcdf78baeabcb8
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/rspec/expectations/differ.rb
@@ -7,8 +7,8 @@ module Expectations
class Differ
# This is snagged from diff/lcs/ldiff.rb (which is a commandline tool)
def diff_as_string(data_new, data_old)
- data_old = data_old.split(Regexp.new matching_encoding('\n',data_old)).map! { |e| e.chomp }
- data_new = data_new.split(Regexp.new matching_encoding('\n',data_new)).map! { |e| e.chomp }
+ data_old = data_old.split(matching_encoding("\n",data_old)).map! { |e| e.chomp }
+ data_new = data_new.split(matching_encoding("\n",data_new)).map! { |e| e.chomp }
diffs = Diff::LCS.diff(data_old, data_new)
output = matching_encoding "", data_old
return output if diffs.empty?

0 comments on commit da0ea8a

Please sign in to comment.