diff --git a/README.md b/README.md index 40e0aa3..fb510d6 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ class ErbSafetyTest < ActiveSupport::TestCase Dir[ERB_GLOB].each do |filename| pathname = Pathname.new(filename).relative_path_from(Rails.root) test "missing javascript escapes in #{pathname}" do - assert_erb_safety File.read(filename) + assert_erb_safety(File.read(filename), filename:) end end end diff --git a/lib/better_html/test_helper/safe_erb_tester.rb b/lib/better_html/test_helper/safe_erb_tester.rb index 557ced7..9a3cac2 100644 --- a/lib/better_html/test_helper/safe_erb_tester.rb +++ b/lib/better_html/test_helper/safe_erb_tester.rb @@ -41,7 +41,7 @@ def assert_erb_safety(data, **options) options[:template_language] ||= :html buffer = ::Parser::Source::Buffer.new(options[:filename] || "(buffer)") buffer.source = data - parser = BetterHtml::Parser.new(buffer, **options) + parser = BetterHtml::Parser.new(buffer, template_language: options[:template_language]) tester_classes = [ SafeErb::NoStatements,