From 5dd3aa40dc16ac664198f89b72076c9eb4c5051d Mon Sep 17 00:00:00 2001 From: Martyn Jago Date: Sat, 28 May 2022 12:35:22 +0100 Subject: [PATCH] Fix call to ERB.new to avoid deprecation warnings. On later Rubies calling create_run_test() causes the generation of warnings of the following form: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated... warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated... This patch removes the noise. --- auto/generate_test_runner.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index b4deb2b..3b35a69 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -345,7 +345,8 @@ class UnityTestRunnerGenerator def create_run_test(output) require 'erb' - template = ERB.new(File.read(File.join(__dir__, 'run_test.erb')), nil, '<>') + file = File.read(File.join(__dir__, 'run_test.erb')) + template = ERB.new(file, trim_mode: '<>') output.puts("\n" + template.result(binding)) end