File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9090 expect ( result ) . to eql ( "<%= yield %>" )
9191 end
9292
93+ it "formats standalone 'yield' with arguments" do
94+ result = subject . format ( "<%=yield x,y%>" )
95+ expect ( result ) . to eql ( "<%= yield x, y %>" )
96+ end
97+
98+ it "formats standalone 'yield' with arguments and parens" do
99+ result = subject . format ( "<%=yield(x,y)%>" )
100+ expect ( result ) . to eql ( "<%= yield(x, y) %>" )
101+ end
102+
93103 it "handles native erb comments" do
94104 result = subject . format ( "<%# locals: (item:, variant:) %>" )
95105 expect ( result ) . to eql ( "<%# locals: (item:, variant:) %>" )
99109 result = subject . format ( "<% # TODO: fix this later %>" )
100110 expect ( result ) . to eql ( "<% # TODO: fix this later %>" )
101111 end
112+
113+ it 'handles case/when expression' do
114+ result = subject . format ( <<~ERB )
115+ <% case a +b %>
116+ <% when c %>
117+ <%= d +e %>
118+ <% end %>
119+ ERB
120+ expect ( result ) . to eql ( <<~ERB )
121+ <% case a + b %>
122+ <% when c %>
123+ <%= d + e %>
124+ <% end %>
125+ ERB
126+ end
102127 end
103128end
You can’t perform that action at this time.
0 commit comments