Class: Cucumber::Formatter::HtmlBuilder
- Inherits:
-
Builder::XmlMarkup
- Object
- Builder::XmlMarkup
- Cucumber::Formatter::HtmlBuilder
show all
- Defined in:
- lib/cucumber/formatter/html_builder.rb
Defined Under Namespace
Classes: InvalidEmbedTypeError
Constant Summary
collapse
- VALID_EMBED_TYPES =
[:text, :image].freeze
Instance Method Summary
collapse
Instance Method Details
#build_document! ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/cucumber/formatter/html_builder.rb', line 26
def build_document!
declare!
self << '<html xmlns ="http://www.w3.org/1999/xhtml">'
set_head_tags
end
|
#declare! ⇒ Object
22
23
24
|
# File 'lib/cucumber/formatter/html_builder.rb', line 22
def declare!
super(:DOCTYPE, :html, :PUBLIC, '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd')
end
|
#embed(type: nil, src: nil, label: nil, id: nil) ⇒ Object
18
19
20
|
# File 'lib/cucumber/formatter/html_builder.rb', line 18
def embed(type: nil, src: nil, label: nil, id: nil)
prepend_to_span('embed', string_to_embed(type: type, src: src, label: label, id: id))
end
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/cucumber/formatter/html_builder.rb', line 34
def format_features!(features)
step_count = features && features.step_count || 0
self << '<body>'
self << "<!-- Step count #{step_count}-->"
self << '<div class="cucumber">'
div(id: 'cucumber-header') do
div(id: 'label') do
h1 'Cucumber Features'
end
summary_div
end
end
|