Skip to content

Commit

Permalink
proxy interaction with underbar to dash mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Jan 15, 2014
1 parent 142a97f commit 4aa5232
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/wunderbar/cssproxy.rb
Expand Up @@ -50,11 +50,11 @@ class << proxy.node?; include CompactNode; end
end
proxy
elsif SpacedNode === @node
@builder.__send__ "_#{@node.name}_", *args, &block
@builder.__send__ "_#{@node.name.to_s.gsub('-', '_')}_", *args, &block
elsif CompactNode === @node and @node.name != :pre
@builder.__send__ "_#{@node.name}!", *args, &block
@builder.__send__ "_#{@node.name.to_s.gsub('-', '_')}!", *args, &block
else
@builder.__send__ "_#{@node.name}", *args, &block
@builder.__send__ "_#{@node.name.to_s.gsub('-', '_')}", *args, &block
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/test_html_markup.rb
Expand Up @@ -307,6 +307,12 @@ def test_multiple_proxy
assert_no_match %r[><\/h1>], target
end

def test_underbar_proxy
@x.html {_my_node.a.b! 'Content'}
assert_match %r[^ +<my-node class="a" id="b">Content</my-node>], target
assert_no_match %r[><\/h1>], target
end

def test_multiple_proxy_spaced
@x.html {_h1; _h1_.a.b.content! 'Content'}
assert_match %r[</h1>\n\n +<h1 class="a b" id="content">], target
Expand Down

0 comments on commit 4aa5232

Please sign in to comment.