diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-08-08 18:54:01 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-08-08 18:54:01 +0000 |
commit | b90739878805d587e00b0112a65e04f921883b75 (patch) | |
tree | 70ff525c45c2d55833e1e90eff7511b17aea843b /test | |
parent | 2e4f3d5a60c15887359d54a62449272731dc9137 (diff) | |
download | redmine-b90739878805d587e00b0112a65e04f921883b75.tar.gz redmine-b90739878805d587e00b0112a65e04f921883b75.zip |
Slight change to the macro regexp.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10178 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/lib/redmine/wiki_formatting/macros_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index 4583d3e9b..42885a7df 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -65,6 +65,17 @@ class Redmine::WikiFormatting::MacrosTest < ActionView::TestCase assert_equal '<p>Bar: () (String)</p>', textilizable("{{bar()}}") end + def test_multiple_macros_on_the_same_line + Redmine::WikiFormatting::Macros.macro :foo do |obj, args| + args.any? ? "args: #{args.join(',')}" : "no args" + end + + assert_equal '<p>no args no args</p>', textilizable("{{foo}} {{foo}}") + assert_equal '<p>args: a,b no args</p>', textilizable("{{foo(a,b)}} {{foo}}") + assert_equal '<p>args: a,b args: c,d</p>', textilizable("{{foo(a,b)}} {{foo(c,d)}}") + assert_equal '<p>no args args: c,d</p>', textilizable("{{foo}} {{foo(c,d)}}") + end + def test_macro_hello_world text = "{{hello_world}}" assert textilizable(text).match(/Hello world!/) |