Skip to content

Commit

Permalink
correctly insert content in replace parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
al2o3cr committed Dec 27, 2011
1 parent 66526f0 commit ba2144c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions dryml/features/replace_parameters.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Feature: replace parameters

Scenario: simple replace parameter
Given a file named "doctest_taglib.dryml" with:
"""
<def tag="myp">
<p param="foo" />
</def>
"""
And a file named "doctest.dryml" with:
"""
<myp><foo: replace>Hello World</foo:></myp>
"""
When I include the taglib "doctest_taglib"
When I render "doctest.dryml"
Then the output DOM should be:
"""
Hello World
"""


2 changes: 1 addition & 1 deletion dryml/lib/dryml/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def param_proc(el)
dryml_exception("replace attribute must not have a value", el) if repl.has_rhs?
dryml_exception("replace parameters must not have attributes", el) if el.attributes.length > 1

replace_parameter_proc(el)
replace_parameter_proc(el, children_to_erb(el))
else
attributes = el.attributes.dup
# Providing one of 'with' or 'field' but not the other should cancel out the other
Expand Down

0 comments on commit ba2144c

Please sign in to comment.