D
David Brady
I am writing some document generation classes now, and testing them with
Test::Unit. The documents are 20-50k in size, and as a good initial
test I'd like to simply generate a document and compare it against the
output of the existing document generator.
What are some good Rubyish ways of doing this?
Is there a Ruby Way to diff text files?
Is there a Ruby Way to assert that two text files are the same?
I suppose I could just write a wrapper to a system call to diff.
Alternately, I could wrapper a method in Test::Unit to read a file into
a gigantic string, and assert_equal that against the contents of another
string. The fail message from this, however, would not only be useless
(100k of text to the console!), but would blind the system to other fail
messages useless as well.
Thoughts?
-dB
Test::Unit. The documents are 20-50k in size, and as a good initial
test I'd like to simply generate a document and compare it against the
output of the existing document generator.
What are some good Rubyish ways of doing this?
Is there a Ruby Way to diff text files?
Is there a Ruby Way to assert that two text files are the same?
I suppose I could just write a wrapper to a system call to diff.
Alternately, I could wrapper a method in Test::Unit to read a file into
a gigantic string, and assert_equal that against the contents of another
string. The fail message from this, however, would not only be useless
(100k of text to the console!), but would blind the system to other fail
messages useless as well.
Thoughts?
-dB