Class: Group
- Inherits:
-
Contextual::Node
- Object
- Contextual::Node
- Group
- Includes:
- Contextual::Child, Contextual::Parent
- Defined in:
- lib/contextual/group.rb
Overview
A Group is a organizational class that holds other tests. You can nest as many groups as you like.
Instance Attribute Summary
Attributes included from Contextual::Parent
Attributes inherited from Contextual::Node
Instance Method Summary collapse
-
#initialize(title, children = [], setup: nil, teardown: nil, options: nil, skip: false) ⇒ Group
constructor
A new instance of Group.
-
#report(filter_settings) ⇒ TestResult, Nil
Report results, if any.
-
#should_run_with_filter(filter_settings) ⇒ Boolean
Should this run with the current filter settings.
Methods included from Contextual::Parent
#assign_parent, #critical_inconclusive, #failures, #get_result, #neutrals, #report_children, #set_parent, #should_run_with_search_term_with_children, #successes, #total
Methods included from Contextual::Child
Methods inherited from Contextual::Node
#get_result, #run, #run_setup, #run_teardown, #should_run_with_search_term
Constructor Details
#initialize(title, children = [], setup: nil, teardown: nil, options: nil, skip: false) ⇒ Group
Returns a new instance of Group.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/contextual/group.rb', line 13 def initialize( title, children = [], setup: nil, teardown: nil, options: nil, skip: false ) super(title, setup: setup, teardown: teardown, options: , skip: skip) set_parent(children) end |
Instance Method Details
#report(filter_settings) ⇒ TestResult, Nil
Report results, if any
39 40 41 42 43 44 |
# File 'lib/contextual/group.rb', line 39 def report(filter_settings) @result.report(@parent_count) return if @skip report_children(filter_settings) end |
#should_run_with_filter(filter_settings) ⇒ Boolean
Should this run with the current filter settings
28 29 30 31 32 33 34 |
# File 'lib/contextual/group.rb', line 28 def should_run_with_filter(filter_settings) # This should run failrly close to testRunner's version return @title == filter_settings.group_search_for if filter_settings.has_group_search_for return @title.include? filter_settings.group_filter_term if filter_settings.has_group_filter_term should_run_with_search_term_with_children(filter_settings) end |