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 | ||
| 3 | 0 | module EquivalenceCases |
| 4 | 0 | module Helpers |
| 5 | 0 | class Helpers < Phlex::HTML |
| 6 | 0 | def initialize |
| 7 | 0 | @dynamic = "dyn<>" |
| 8 | end | |
| 9 | ||
| 10 | 0 | def view_template |
| 11 | 0 | doctype |
| 12 | 0 | plain "text<>" |
| 13 | 0 | plain @dynamic |
| 14 | 0 | plain 42 |
| 15 | 0 | whitespace |
| 16 | 0 | whitespace { span { "x" } } |
| 17 | 0 | comment { "hi" } |
| 18 | 0 | comment { span { "el" } } |
| 19 | 0 | raw safe("<x>") |
| 20 | 0 | raw nil |
| 21 | 0 | div { raw(nil); "fallback" } |
| 22 | end | |
| 23 | end | |
| 24 | ||
| 25 | 0 | class Mix < Phlex::HTML |
| 26 | 0 | def initialize |
| 27 | 0 | @symbol = :baz_qux |
| 28 | end | |
| 29 | ||
| 30 | 0 | def view_template |
| 31 | 0 | div(**mix({ class: "foo_bar" }, { class: @symbol })) |
| 32 | 0 | div(**mix({ class: :foo_bar }, { class: [@symbol] })) |
| 33 | 0 | div(**mix({ class: Set[:foo_bar] }, { class: @symbol })) |
| 34 | end | |
| 35 | end | |
| 36 | ||
| 37 | 0 | class RawUnsafe < Phlex::HTML |
| 38 | 0 | def view_template |
| 39 | 0 | div { raw "unsafe" } |
| 40 | end | |
| 41 | end | |
| 42 | ||
| 43 | 0 | class PlainObject < Phlex::HTML |
| 44 | 0 | def view_template |
| 45 | 0 | plain Object.new |
| 46 | end | |
| 47 | end | |
| 48 | end | |
| 49 | end |