Sha256: 1ea46bb50b15a6bd11ddd68669257d68ac1d04c42388e41b4128728049f536c0

Contents?: true

Size: 1.66 KB

Versions: 6

Compression:

Stored size: 1.66 KB

Contents

require 'helper'
require 'slim/erb_converter'

class TestSlimERBConverter < TestSlim
  def test_converter
        source = %q{
doctype 5
html
  head
    title Hello World!
    /! Meta tags
       with long explanatory
       multiline comment
    meta name="description" content="template language"
    /! Stylesheets
    link href="style.css" media="screen" rel="stylesheet" type="text/css"
    link href="colors.css" media="screen" rel="stylesheet" type="text/css"
    /! Javascripts
    script src="jquery.js"
    script src="jquery.ui.js"
    /[if lt IE 9]
      script src="old-ie1.js"
      script src="old-ie2.js"
    sass:
      body
        background-color: red
  body
    #container
      p Hello
        World!
      p= "dynamic text with\nnewline"
}

    result = %q{<%
%><!DOCTYPE html><%
%><html><%
%><head><%
%><title>Hello World!</title><%
%><!--Meta tags<%
%>
with long explanatory<%
%>
multiline comment--><%
%><meta content="template language" name="description" /><%
%><!--Stylesheets--><%
%><link href="style.css" media="screen" rel="stylesheet" type="text/css" /><%
%><link href="colors.css" media="screen" rel="stylesheet" type="text/css" /><%
%><!--Javascripts--><%
%><script src="jquery.js"><%
%></script><script src="jquery.ui.js"><%
%></script><!--[if lt IE 9]><%
%><script src="old-ie1.js"><%
%></script><script src="old-ie2.js"><%
%></script><![endif]--><style type="text/css">body{background-color:red}<%
%><%
%></style><%
%></head><body><%
%><div id="container"><%
%><p>Hello<%
%>
World!</p><%
%><p><%= ::Temple::Utils.escape_html(("dynamic text with\nnewline")) %><%
%></p></div></body></html>}

    assert_equal result, Slim::ERBConverter.new.call(source)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slim-3.0.0.beta.2 test/core/test_erb_converter.rb
slim-2.1.0 test/core/test_erb_converter.rb
slim-2.0.3 test/core/test_erb_converter.rb
slim-2.0.2 test/core/test_erb_converter.rb
slim-2.0.1 test/core/test_erb_converter.rb
slim-2.0.0 test/core/test_erb_converter.rb