From 687e6db0795d49504d30dcf6c95104dd2c07e277 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 12 Sep 2024 15:19:46 +0900 Subject: [PATCH] test markdown: follow message format change --- lib/rabbit/parser/markdown/converter.rb | 6 +++--- test/parser/test-markdown.rb | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/rabbit/parser/markdown/converter.rb b/lib/rabbit/parser/markdown/converter.rb index 2464be96..9cf291f6 100644 --- a/lib/rabbit/parser/markdown/converter.rb +++ b/lib/rabbit/parser/markdown/converter.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2022 Sutou Kouhei +# Copyright (C) 2012-2024 Sutou Kouhei # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -170,10 +170,10 @@ def convert_p(element) _("multiple ![alt]{image}s in a paragraph isn't supported.") end if child_types.include?(:img) - message = + format = _("![alt]{image} and other contents in a paragraph " \ "isn't supported: %{types}") - raise ParseError, message % {types: child_types} + raise ParseError, format % {types: child_types} end if element.options[:transparent] and child_types == [:text] element.children.first.value.chomp! diff --git a/test/parser/test-markdown.rb b/test/parser/test-markdown.rb index f8f8107d..14c12a11 100644 --- a/test/parser/test-markdown.rb +++ b/test/parser/test-markdown.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2022 Sutou Kouhei +# Copyright (C) 2014-2024 Sutou Kouhei # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -287,7 +287,8 @@ class InlineTest < self def test_unsupported image_path = fixture_path("image/png/lavie.png") - message = _("![alt]{image} and other contents in a paragraph isn't supported: [:text, :img]") + format = _("![alt]{image} and other contents in a paragraph isn't supported: %{types}") + message = format % {types: [:text, :img]} assert_raise(Rabbit::ParseError.new(message)) do parse(<<-MARKDOWN) a ![](#{image_path})