quickdraw/compilation_equivalence_cases/helpers.rb

Lines

0%

0 of 30 covered

Branches

—

0 of 0 covered

Methods

0%

0 of 6 covered

Not run
3-710-2125-2730-3337-3943-45
Never called
1# frozen_string_literal: true
2
30module EquivalenceCases
40 module Helpers
50 class Helpers < Phlex::HTML
60 def initialize
70 @dynamic = "dyn<>"
8 end
9
100 def view_template
110 doctype
120 plain "text<>"
130 plain @dynamic
140 plain 42
150 whitespace
160 whitespace { span { "x" } }
170 comment { "hi" }
180 comment { span { "el" } }
190 raw safe("<x>")
200 raw nil
210 div { raw(nil); "fallback" }
22 end
23 end
24
250 class Mix < Phlex::HTML
260 def initialize
270 @symbol = :baz_qux
28 end
29
300 def view_template
310 div(**mix({ class: "foo_bar" }, { class: @symbol }))
320 div(**mix({ class: :foo_bar }, { class: [@symbol] }))
330 div(**mix({ class: Set[:foo_bar] }, { class: @symbol }))
34 end
35 end
36
370 class RawUnsafe < Phlex::HTML
380 def view_template
390 div { raw "unsafe" }
40 end
41 end
42
430 class PlainObject < Phlex::HTML
440 def view_template
450 plain Object.new
46 end
47 end
48 end
49end