diff --git a/spec/samples/samples_regression_spec.rb b/spec/samples/samples_regression_spec.rb index 57afdfc..313e54f 100644 --- a/spec/samples/samples_regression_spec.rb +++ b/spec/samples/samples_regression_spec.rb @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f0c48f9..893ea45 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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