quickdraw/compilation_equivalence_cases/forwarded_block.rb
Lines
0%0 of 20 covered
Branches
—0 of 0 covered
Methods
0%0 of 4 covered
- Not run
- 3-1217-1922-2327-3032
- Never called
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 0 | module EquivalenceCases |
| 4 | 0 | module ForwardedBlock |
| 5 | 0 | class ForwardedBlock < Phlex::HTML |
| 6 | 0 | def view_template |
| 7 | 0 | div(&content_block) |
| 8 | 0 | div(class: "x", &content_block) |
| 9 | 0 | section(&nil) |
| 10 | 0 | section(class: "y", &nil) |
| 11 | 0 | wrapper { "in" } |
| 12 | 0 | wrapper |
| 13 | end | |
| 14 | ||
| 15 | # Writes to the buffer before the element opens, and the block it | |
| 16 | # returns writes inside the element. | |
| 17 | 0 | def content_block |
| 18 | 0 | plain "before" |
| 19 | 0 | proc { span { "inside" }; "value" } |
| 20 | end | |
| 21 | ||
| 22 | 0 | def wrapper(&) |
| 23 | 0 | article(id: "w", &) |
| 24 | end | |
| 25 | end | |
| 26 | ||
| 27 | 0 | class InvalidAttributeWithNilBlock < Phlex::HTML |
| 28 | 0 | def view_template |
| 29 | 0 | block = nil |
| 30 | 0 | div(class: Object.new, &block) |
| 31 | rescue Phlex::ArgumentError | |
| 32 | 0 | plain "rescued" |
| 33 | end | |
| 34 | end | |
| 35 | end | |
| 36 | end |