Skip to content

Commit

Permalink
Modify test to work with new :return_buffer behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Oct 23, 2018
1 parent c3eac9f commit d3bc72c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -671,22 +671,25 @@ def self.quux
@options[:bufvar] = '@a'

def self.bar
@a << "a"
a = String.new
a << "a"
yield 'burgers'
yield 'salads'
@a << 'b'
@a.upcase!
nil
case b = (yield 'salads')
when String
a << b
a << 'b'
a.upcase
end
end

check_output(<<END1, <<END2, <<END3){}
<%|= bar do |item| %>
Let's eat <%= item %>!
<%| end %>
<% nil %><%| end %>
END1
@a = String.new;begin; (__erubi_stack ||= []) << @a; @a = String.new; __erubi_stack.last << (( bar do |item| @a << '
'; @a << 'Let\\'s eat '; @a << ( item ).to_s; @a << '!
'; end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
'; nil ; end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
';
@a.to_s
END2
Expand All @@ -698,11 +701,11 @@ def self.bar
check_output(<<END1, <<END2, <<END3) {}
<%|= bar do |item| %>
Let's eat <%= item %>!
<%| end %>
<% nil %><%| end %>
END1
@a = String.new;begin; (__erubi_stack ||= []) << @a; @a = String.new; __erubi_stack.last << (( bar do |item| @a << '
'; @a << 'Let\\'s eat '; @a << ( item ).to_s; @a << '!
'; end ; @a; )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
'; nil ; @a; end )).to_s; ensure; @a = __erubi_stack.pop; end; @a << '
';
@a.to_s
END2
Expand Down

0 comments on commit d3bc72c

Please sign in to comment.