Class: Tengu::DescribeBlock
- Inherits:
-
Object
- Object
- Tengu::DescribeBlock
- Defined in:
- lib/tengu/describe_block.rb
Instance Method Summary collapse
-
#initialize(description, block) ⇒ DescribeBlock
constructor
A new instance of DescribeBlock.
- #pending_count ⇒ Object
- #run(listeners = []) ⇒ Object
- #success_count ⇒ Object
- #test_count ⇒ Object
Constructor Details
#initialize(description, block) ⇒ DescribeBlock
Returns a new instance of DescribeBlock.
3 4 5 6 7 8 9 10 |
# File 'lib/tengu/describe_block.rb', line 3 def initialize(description, block) @description = description @block = block @test_cases = [] @before_each_hooks = [] @after_each_hooks = [] load_test_cases end |
Instance Method Details
#pending_count ⇒ Object
24 25 26 |
# File 'lib/tengu/describe_block.rb', line 24 def pending_count @test_cases.count { |test_case| test_case.pending? } end |
#run(listeners = []) ⇒ Object
12 13 14 |
# File 'lib/tengu/describe_block.rb', line 12 def run(listeners = []) run_test_cases(listeners) end |
#success_count ⇒ Object
16 17 18 |
# File 'lib/tengu/describe_block.rb', line 16 def success_count @test_cases.count { |test_case| test_case.success? } end |
#test_count ⇒ Object
20 21 22 |
# File 'lib/tengu/describe_block.rb', line 20 def test_count @test_cases.count { |test_case| !test_case.pending? } end |