Skip to content

Commit aa7cc52

Browse files
committed
Test capture with arguments
1 parent 9ee7dde commit aa7cc52

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

quickdraw/sgml/capture.test.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# frozen_string_literal: true
2+
3+
class ExampleCaptureWithArguments < Phlex::HTML
4+
def view_template(&block)
5+
h1 { capture("a", "b", "c", &block) }
6+
end
7+
end
8+
9+
test "arguments are passed to the capture block" do
10+
output = ExampleCaptureWithArguments.new.call do |a, b, c|
11+
"#{a} #{b} #{c}"
12+
end
13+
14+
expect(output) == "<h1>a b c</h1>"
15+
end

0 commit comments

Comments
 (0)