Skip to content

Commit

Permalink
updated template param test
Browse files Browse the repository at this point in the history
  • Loading branch information
David Ricciardi committed Sep 23, 2010
1 parent 6eb9003 commit 96f0c1c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/wiki_cloth_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class WikiParser < WikiCloth::Parser
"hello world"
when "testparams"
"{{{def|hello world}}} {{{1}}} {{{test}}} {{{nested|{{{2}}}}}}"
when "moreparamtest"
"{{{{{{p}}}|wtf}}}"
end
end
external_link do |url,text|
Expand All @@ -29,12 +31,20 @@ class WikiClothTest < ActiveSupport::TestCase
end

test "template params" do
wiki = WikiParser.new(:data => "{{testparams|test|test=bla|it worked}}\n")
wiki = WikiParser.new(:data => "{{testparams|test|test=bla|it worked|bla=whoo}}\n")
data = wiki.to_html
assert data =~ /hello world/
assert data =~ /test/
assert data =~ /bla/
assert data =~ /it worked/ # nested default param

wiki = WikiParser.new(:data => "{{moreparamtest|p=othervar}}")
data = wiki.to_html
assert data =~ /wtf/

wiki = WikiParser.new(:data => "{{moreparamtest|p=othervar|othervar=whoo}}")
data = wiki.to_html
assert data =~ /whoo/
end

test "horizontal rule" do
Expand Down

0 comments on commit 96f0c1c

Please sign in to comment.