Sha256: f8384a74c4bd7bb7bb213a9b8700c271b76a513627e032658245a4903b2df019

Contents?: true

Size: 1.01 KB

Versions: 29

Compression:

Stored size: 1.01 KB

Contents

describe Hamlit::Parser do
  describe 'comment' do
    it 'renders html comment' do
      assert_render(<<-HAML, <<-HTML)
        / comments
      HAML
        <!-- comments -->
      HTML
    end

    it 'strips html comment ignoring around spcaes' do
      assert_render('/   comments    ', <<-HTML)
        <!-- comments -->
      HTML
    end

    it 'accepts backslash-only line in a comment' do
      assert_render(<<-'HAML', <<-HTML)
        /
          \
      HAML
        <!--

        -->
      HTML
    end

    it 'renders a deeply indented comment starting with backslash' do
      assert_render(<<-'HAML', <<-HTML)
        /
          \       a
        /
          a
      HAML
        <!--
               a
        -->
        <!--
        a
        -->
      HTML
    end

    it 'ignores multiline comment' do
      assert_render(<<-'HAML', <<-HTML)
        -# if true
          - raise 'ng'
            = invalid script
                too deep indent
        ok
      HAML
        ok
      HTML
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hamlit-1.7.2 spec/hamlit/engine/comment_spec.rb
hamlit-1.7.1 spec/hamlit/engine/comment_spec.rb
hamlit-1.7.0 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.7 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.6 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.5 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.4 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.3 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.2 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.1 spec/hamlit/engine/comment_spec.rb
hamlit-1.6.0 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.9 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.8 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.7 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.6 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.5 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.4 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.3 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.2 spec/hamlit/engine/comment_spec.rb
hamlit-1.5.1 spec/hamlit/engine/comment_spec.rb