quickdraw/compilation_equivalence_cases/yield_arguments.rb

Lines

0%

0 of 21 covered

Branches

—

0 of 0 covered

Methods

0%

0 of 6 covered

Not run
3-711-1214-1922-2327-3033-34
Never called
1# frozen_string_literal: true
2
30module EquivalenceCases
40 module YieldArguments
50 class Other < Phlex::HTML
60 def view_template
70 div(class: "other") { yield(self, "arg") }
8 end
9 end
10
110 class YieldArguments < Phlex::HTML
120 def self.equivalence_scenarios = { "with block" => -> (klass) { klass.new.call { "blk" } } }
13
140 def view_template(&block)
150 div { |el| el.span { "x" } }
160 render Other.new { |x, arg| x.b { arg } }
170 render(Other.new) { |x, arg| x.i { arg } }
180 section { yield }
190 article { yield_block(&block) }
20 end
21
220 def yield_block
230 p { yield }
24 end
25 end
26
270 class WithBlockMethod < Phlex::HTML
280 def view_template
290 wrapper { span { "inner" } }
300 wrapper { "text" }
31 end
32
330 def wrapper(&)
340 div(class: "wrap") { yield }
35 end
36 end
37 end
38end