Skip to content

Commit

Permalink
Merge 4406a0d into 22ecfa4
Browse files Browse the repository at this point in the history
  • Loading branch information
flyerhzm committed Jan 30, 2021
2 parents 22ecfa4 + 4406a0d commit 1891783
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 40 deletions.
56 changes: 28 additions & 28 deletions spec/synvert/core/engine/erb_spec.rb
Expand Up @@ -5,34 +5,34 @@
module Synvert::Core
describe Engine::ERB do
it 'encodes / decodes' do
source = <<-EOF
<%content_for :head do%>
<style>
body {
background-image: url(<%= asset_path('bg.png') %>);
}
</style>
<%end%>
<%
foo = 'bar'
post = Post.find(:first)
bar = 'foo'
%>
<% if User.current &&
User.current.admin %>
<%= rounded_content("page") do %>
<div class='test'>
<% if post %>
<div id="title"><%= foo %></div>
<% form_for post do |f| %>
<label><%= link_to_function 'test', "confirm('test');" %></label>
<%= f.text_field 'bar' %>
<% end %>
<% end %></div>
<% end %>
<% end %>
source = <<~EOF
<%content_for :head do%>
<style>
body {
background-image: url(<%= asset_path('bg.png') %>);
}
</style>
<%end%>
<%
foo = 'bar'
post = Post.find(:first)
bar = 'foo'
%>
<% if User.current &&
User.current.admin %>
<%= rounded_content("page") do %>
<div class='test'>
<% if post %>
<div id="title"><%= foo %></div>
<% form_for post do |f| %>
<label><%= link_to_function 'test', "confirm('test');" %></label>
<%= f.text_field 'bar' %>
<% end %>
<% end %></div>
<% end %>
<% end %>
EOF
encoded_source = Engine::ERB.encode(source)
buffer = Parser::Source::Buffer.new '(test)'
Expand Down
24 changes: 12 additions & 12 deletions spec/synvert/core/node_ext_spec.rb
Expand Up @@ -419,21 +419,21 @@
end

it 'rewrites array with multi line given as argument for method' do
source = <<-EOS.strip
long_name_method([
1,
2,
3
])
source = <<~EOS.strip
long_name_method([
1,
2,
3
])
EOS

node = parse(source)
expect(node.rewritten_source('{{arguments}}')).to eq <<-EOS.strip
[
1,
2,
3
]
expect(node.rewritten_source('{{arguments}}')).to eq <<~EOS.strip
[
1,
2,
3
]
EOS
end
end
Expand Down

0 comments on commit 1891783

Please sign in to comment.