quickdraw/compilation_equivalence_cases/modifier_conditionals.rb
Lines
0%0 of 16 covered
Branches
0%0 of 6 covered
Methods
0%0 of 3 covered
- Not run
- 3-8111317-24
- Never called
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 0 | module EquivalenceCases |
| 4 | 0 | module ModifierConditionals |
| 5 | 0 | class ModifierConditionals < Phlex::HTML |
| 6 | 0 | def initialize(flag: false) |
| 7 | 0 | @flag = flag |
| 8 | 0 | @content = "content" |
| 9 | end | |
| 10 | ||
| 11 | 0 | def self.equivalence_scenarios |
| 12 | { | |
| 13 | 0 | "flag on" => -> (klass) { klass.new(flag: true).call }, |
| 14 | } | |
| 15 | end | |
| 16 | ||
| 17 | 0 | def view_template |
| 18 | 0 | b { "always" } |
| 19 | 0 | span(class: "x") { plain @content } if @flag |
| 20 | 0 | em { @content } unless @flag |
| 21 | 0 | count = 0 |
| 22 | 0 | p { plain "loop #{count += 1}" } while count < 2 && @flag |
| 23 | 0 | strong { count.to_s } until true |
| 24 | 0 | i { "end" } |
| 25 | end | |
| 26 | end | |
| 27 | end | |
| 28 | end |