quickdraw/compilation_equivalence_cases/prepended_namespace.rb
Lines
100%11 of 11 covered
Branches
—0 of 0 covered
Methods
75%3 of 4 covered
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 1 | module EquivalenceCases |
| 4 | 1 | module PrependedNamespace |
| 5 | 1 | class View < Phlex::HTML |
| 6 | 1 | def view_template = part |
| 7 | ||
| 8 | 1 | def div(**, &) = plain("custom") |
| 9 | end | |
| 10 | ||
| 11 | # Prepending puts this module before the namespace in its ancestors, but | |
| 12 | # `PrependedNamespace::View` still names the namespace's own View. | |
| 13 | 1 | module Prepended |
| 14 | 1 | class View < PrependedNamespace::View |
| 15 | 1 | register_element :div |
| 16 | end | |
| 17 | end | |
| 18 | ||
| 19 | 1 | prepend Prepended |
| 20 | end | |
| 21 | ||
| 22 | 1 | class PrependedNamespace::View |
| 23 | 7 | def part = div { "body" } |
| 24 | end | |
| 25 | end |