Class: Whitestone::Scope
Overview
A Scope object contains a group of Test objects and the setup and teardown information for that group. A āDā method opens a new scope.
Instance Attribute Summary collapse
-
#after_all ⇒ Object
readonly
Returns the value of attribute after_all.
-
#after_each ⇒ Object
readonly
Returns the value of attribute after_each.
-
#before_all ⇒ Object
readonly
Returns the value of attribute before_all.
-
#before_each ⇒ Object
readonly
Returns the value of attribute before_each.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Instance Method Summary collapse
- #filter(regex) ⇒ Object
-
#initialize ⇒ Scope
constructor
A new instance of Scope.
Constructor Details
#initialize ⇒ Scope
Returns a new instance of Scope.
78 79 80 81 82 83 84 |
# File 'lib/whitestone.rb', line 78 def initialize @tests = [] @before_each = [] @after_each = [] @before_all = [] @after_all = [] end |
Instance Attribute Details
#after_all ⇒ Object (readonly)
Returns the value of attribute after_all.
77 78 79 |
# File 'lib/whitestone.rb', line 77 def after_all @after_all end |
#after_each ⇒ Object (readonly)
Returns the value of attribute after_each.
77 78 79 |
# File 'lib/whitestone.rb', line 77 def after_each @after_each end |
#before_all ⇒ Object (readonly)
Returns the value of attribute before_all.
77 78 79 |
# File 'lib/whitestone.rb', line 77 def before_all @before_all end |
#before_each ⇒ Object (readonly)
Returns the value of attribute before_each.
77 78 79 |
# File 'lib/whitestone.rb', line 77 def before_each @before_each end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
77 78 79 |
# File 'lib/whitestone.rb', line 77 def tests @tests end |
Instance Method Details
#filter(regex) ⇒ Object
85 86 87 |
# File 'lib/whitestone.rb', line 85 def filter(regex) @tests = @tests.select { |t| t.description =~ regex } end |