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