Class: Tina4::Testing::TestSuite
- Inherits:
-
Object
- Object
- Tina4::Testing::TestSuite
- Defined in:
- lib/tina4/testing.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tests ⇒ Object
readonly
Returns the value of attribute tests.
Instance Method Summary collapse
- #after_each(&block) ⇒ Object
- #before_each(&block) ⇒ Object
-
#initialize(name) ⇒ TestSuite
constructor
A new instance of TestSuite.
- #it(description, &block) ⇒ Object
- #run_after_each ⇒ Object
- #run_before_each ⇒ Object
Constructor Details
#initialize(name) ⇒ TestSuite
Returns a new instance of TestSuite.
203 204 205 206 207 208 |
# File 'lib/tina4/testing.rb', line 203 def initialize(name) @name = name @tests = [] @before_each = nil @after_each = nil end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
201 202 203 |
# File 'lib/tina4/testing.rb', line 201 def name @name end |
#tests ⇒ Object (readonly)
Returns the value of attribute tests.
201 202 203 |
# File 'lib/tina4/testing.rb', line 201 def tests @tests end |
Instance Method Details
#after_each(&block) ⇒ Object
218 219 220 |
# File 'lib/tina4/testing.rb', line 218 def after_each(&block) @after_each = block end |
#before_each(&block) ⇒ Object
214 215 216 |
# File 'lib/tina4/testing.rb', line 214 def before_each(&block) @before_each = block end |
#it(description, &block) ⇒ Object
210 211 212 |
# File 'lib/tina4/testing.rb', line 210 def it(description, &block) @tests << { name: description, block: block } end |
#run_after_each ⇒ Object
226 227 228 |
# File 'lib/tina4/testing.rb', line 226 def run_after_each @after_each&.call end |
#run_before_each ⇒ Object
222 223 224 |
# File 'lib/tina4/testing.rb', line 222 def run_before_each @before_each&.call end |