Good heavens, no! Neither of those are thread safe. Criminy!

Why not something simple like so:

require 'enumerator'

def compare_by_line( expected, actual, message )
  expected_lines = expected.to_enum(:each_line)
  actual_lines = actual.to_enum(:each_line)
  expected_lines.zip(actual_lines).each_with_index do |pair, index|
    assert_equal( *pair, "#{message} on line #{index + 1}")
  end
end

compare_by_line( @html_reference, cal.to_html, "Calendar.to_html incorrect" )

There's no need for threads...

Jacob Fugal