mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Unfreeze string literals for ParseNode#inspect
This commit is contained in:
parent
a054e2ad79
commit
bc881814e6
2 changed files with 9 additions and 1 deletions
|
@ -202,7 +202,7 @@ module Haml
|
|||
end
|
||||
|
||||
def inspect
|
||||
%Q[(#{type} #{value.inspect}#{children.each_with_object('') {|c, s| s << "\n#{c.inspect.gsub!(/^/, ' ')}"}})]
|
||||
%Q[(#{type} #{value.inspect}#{children.each_with_object(''.dup) {|c, s| s << "\n#{c.inspect.gsub!(/^/, ' ')}"}})].dup
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -96,6 +96,14 @@ module Haml
|
|||
end
|
||||
end
|
||||
|
||||
test "inspect for node with children returns text" do
|
||||
text = "some revealed text"
|
||||
cond = "[cond]"
|
||||
node = parse("/!#{cond} #{text}")
|
||||
|
||||
assert_equal "(root nil\n (comment {:conditional=>\"[cond]\", :text=>\"some revealed text\", :revealed=>true, :parse=>false}))", node.inspect
|
||||
end
|
||||
|
||||
test "revealed conditional comments are detected" do
|
||||
text = "some revealed text"
|
||||
cond = "[cond]"
|
||||
|
|
Loading…
Add table
Reference in a new issue