Sha256: 1809ce47687dc6e3c3b83c5d3909c09949b172ea15286a24edf413e3f73d983b
Contents?: true
Size: 1.21 KB
Versions: 17
Compression:
Stored size: 1.21 KB
Contents
describe Hamlit::Compiler do describe 'script' do let(:options) do { force_escape: false, disable_escape: false } end it 'compiles hamlit script ast into assigning' do assert_compile( [:haml, :script, 'link_to user_path do', options, [:static, 'user']], [:multi, [:code, "_hamlit_compiler0 = link_to user_path do"], [:static, "user"], [:escape, false, [:dynamic, "(_hamlit_compiler0).to_s"]]], ) end it 'compiles multiple hamlit scripts' do assert_compile( [:multi, [:haml, :script, 'link_to user_path do', options, [:static, 'user']], [:haml, :script, 'link_to repo_path do', options, [:static, 'repo']]], [:multi, [:multi, [:code, "_hamlit_compiler0 = link_to user_path do"], [:static, "user"], [:escape, false, [:dynamic, "(_hamlit_compiler0).to_s"]]], [:multi, [:code, "_hamlit_compiler1 = link_to repo_path do"], [:static, "repo"], [:escape, false, [:dynamic, "(_hamlit_compiler1).to_s"]]]], ) end end end
Version data entries
17 entries across 17 versions & 1 rubygems