Being more specific about encoding
parent
996fab90bd
commit
9e45726bdf
|
|
@ -63,9 +63,8 @@ describe "Squib samples" do
|
|||
log = StringIO.new
|
||||
mock_cairo(log)
|
||||
load sample
|
||||
overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log
|
||||
test_file_str = File.open(sample_regression_file(sample))
|
||||
.read.force_encoding("UTF-8").encode("UTF-8")
|
||||
# overwrite_sample(sample, log) # Use TEMPORARILY once happy with the new sample log
|
||||
test_file_str = File.open(sample_regression_file(sample), 'r:UTF-8').read
|
||||
expect(log.string).to eq(test_file_str)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ end
|
|||
|
||||
def overwrite_sample(sample_name, log)
|
||||
# Use this to overwrite the regression with current state
|
||||
File.open(sample_regression_file(sample_name), 'w+') do |f|
|
||||
f.write(log.string.force_encoding("UTF-8").encode("UTF-8"))
|
||||
File.open(sample_regression_file(sample_name), 'w+:UTF-8') do |f|
|
||||
f.write(log.string)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue