quickdraw/compilation_equivalence_cases/nested_fragments.rb
Lines
0%0 of 18 covered
Branches
—0 of 0 covered
Methods
0%0 of 2 covered
- Not run
- 3-68-1216-2325
- Never called
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 0 | module EquivalenceCases |
| 4 | 0 | module NestedFragments |
| 5 | 0 | class NestedFragments < Phlex::HTML |
| 6 | 0 | def self.equivalence_scenarios |
| 7 | { | |
| 8 | 0 | "outer only" => -> (klass) { klass.new.call(fragments: ["outer"]) }, |
| 9 | 0 | "inner only" => -> (klass) { klass.new.call(fragments: ["inner"]) }, |
| 10 | 0 | "id and inner" => -> (klass) { klass.new.call(fragments: ["id", "inner"]) }, |
| 11 | 0 | "outer and missing" => -> (klass) { klass.new.call(fragments: ["outer", "nonexistent"]) }, |
| 12 | 0 | "inner and missing" => -> (klass) { klass.new.call(fragments: ["inner", "nonexistent"]) }, |
| 13 | } | |
| 14 | end | |
| 15 | ||
| 16 | 0 | def view_template |
| 17 | 0 | div { "before" } |
| 18 | 0 | fragment("id") { div { "x" } } |
| 19 | 0 | div { "after" } |
| 20 | 0 | fragment("outer") do |
| 21 | 0 | p { "o1" } |
| 22 | 0 | fragment("inner") { span { "in" } } |
| 23 | 0 | p { "o2" } |
| 24 | end | |
| 25 | 0 | div { "tail" } |
| 26 | end | |
| 27 | end | |
| 28 | end | |
| 29 | end |