ruby - How do I compare two text files with rspec? -


i have method compares if 2 text files have same content.

how compare if 2 text files have same content using rspec?

on trivial level:

io.read(file1).should == io.read(file2) 

if want nicer, you're going need write new matcher, have_same_content_as defined check above condition. "up , running custom rspec matchers" nice tutorial on writing custom matchers.


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -