tags:

views:

178

answers:

1

I am generating some XML using a builder, and would like to compare the results to some file contents. However, since the strings are so long, the output is hard to read when the strings differ.

I know there are a number of libraries for diffing strings in ruby, but is there a built in facility in rspec for generating multiline string comparison failures that are easier to read?

+1  A: 

Okay, got it. You need to use the --diff option with the following:

actual_multiline_string.should == expected_multiline_string

NOT

actual_multiline_string.should eql(expected_multiline_string)
Chris Garrett