Class: Tengu::DescribeBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/tengu/describe_block.rb

Instance Method Summary collapse

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_countObject



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_countObject



16
17
18
# File 'lib/tengu/describe_block.rb', line 16

def success_count
  @test_cases.count { |test_case| test_case.success? }
end

#test_countObject



20
21
22
# File 'lib/tengu/describe_block.rb', line 20

def test_count
  @test_cases.count { |test_case| !test_case.pending? }
end