Class: Cuporter::Node::Types::Report
- Includes:
- FeatureNodeFinder
- Defined in:
- lib/cuporter/node/types.rb
Constant Summary collapse
- TAGLESS =
"Untagged Features"
Instance Method Summary collapse
-
#defoliate! ⇒ Object
remove leaf nodes, i.e., the scenario and scenario outline children.
- #move_tagless_node_to_bottom ⇒ Object
- #remove_files! ⇒ Object
- #remove_tags! ⇒ Object
- #tag_node(tag) ⇒ Object
Methods included from FeatureNodeFinder
Instance Method Details
#defoliate! ⇒ Object
remove leaf nodes, i.e., the scenario and scenario outline children
21 22 23 24 |
# File 'lib/cuporter/node/types.rb', line 21 def defoliate! leaves = search("feature > scenario, feature > scenario_outline") leaves.remove end |
#move_tagless_node_to_bottom ⇒ Object
36 37 38 39 |
# File 'lib/cuporter/node/types.rb', line 36 def move_tagless_node_to_bottom tagless = at("tag[cuke_name='#{TAGLESS}']") add_child(tagless.remove) if tagless end |
#remove_files! ⇒ Object
26 27 28 |
# File 'lib/cuporter/node/types.rb', line 26 def remove_files! search(:feature).each {|f| f.delete('file_path') } end |
#remove_tags! ⇒ Object
30 31 32 |
# File 'lib/cuporter/node/types.rb', line 30 def search("*[@tags]").each {|e| e.delete('tags') } end |
#tag_node(tag) ⇒ Object
16 17 18 |
# File 'lib/cuporter/node/types.rb', line 16 def tag_node(tag) at("tag[cuke_name='#{tag}']") end |