File: doctype_test.rb

package info (click to toggle)
ruby-haml 7.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,996 kB
  • sloc: ruby: 9,939; sh: 23; makefile: 11
file content (31 lines) | stat: -rw-r--r-- 734 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true

describe Haml::Engine do
  include RenderHelper

  describe 'doctype' do
    it 'renders html5 doctype' do
      assert_render(<<-HTML.unindent, <<-HAML.unindent)
        <!DOCTYPE html>
      HTML
        !!!
      HAML
    end

    it 'renders xml doctype' do
      assert_render(<<-HTML.unindent, <<-HAML.unindent, format: :xhtml)
        <?xml version='1.0' encoding='utf-8' ?>
      HTML
        !!! XML
      HAML
    end

    it 'renders rdfa doctype' do
      assert_render(<<-HTML.unindent, <<-HAML.unindent, format: :xhtml)
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
      HTML
        !!! RDFa
      HAML
    end
  end
end