test/helper.rb in tracksperanto-1.9.2 vs test/helper.rb in tracksperanto-1.9.3
- old
+ new
@@ -70,17 +70,24 @@
yield(x) if block_given?
export_parabolics_with(x)
end
end
- def ensure_same_output(exporter_klass, reference_path, message = "Should write identical output")
+ def ensure_same_output(exporter_klass, reference_path, message = "The line should be identical")
io = StringIO.new
x = exporter_klass.new(io)
yield(x) if block_given?
export_parabolics_with(x)
- io.close
+ io.rewind
- assert_equal File.read(reference_path), io.string, message
+ File.open(reference_path, "r") do | f |
+ at_line = 0
+ until f.eof? || io.eof?
+ at_line += 1
+ reference_line, output_line = f.readline, io.readline
+ assert_equal reference_line, output_line, "Line #{at_line} - #{message}"
+ end
+ end
end
def export_parabolics_with(exporter)
exporter.start_export(1920, 1080)
[FIRST_TRACK, SECOND_TRACK].each do | t |
\ No newline at end of file