Skip to content

Commit

Permalink
Cover some rspace/lspace branches in CaptureEndEngine
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Nov 13, 2020
1 parent 49f1b33 commit d20b4ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test.rb
Expand Up @@ -278,6 +278,14 @@ def self.quux
@a.must_equal 'bar'
end

it "should handle trailing rspace with - modifier in <%|= and <%|" do
eval(::Erubi::CaptureEndEngine.new("<%|= '&' -%>\n<%| -%>\n").src).must_equal '&'
end

it "should handle lspace in <%|=" do
eval(::Erubi::CaptureEndEngine.new("<%|= %><%| %><%|= %><%| %>").src).must_equal ''
end

it "should have <%|= with CaptureEndEngine not escape by default" do
eval(::Erubi::CaptureEndEngine.new('<%|= "&" %><%| %>').src).must_equal '&'
eval(::Erubi::CaptureEndEngine.new('<%|= "&" %><%| %>', :escape=>false).src).must_equal '&'
Expand Down

0 comments on commit d20b4ed

Please sign in to comment.