Class: Cucumber::RunningTestCase::TestCase

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/cucumber/running_test_case.rb

Instance Method Summary collapse

Constructor Details

#initialize(test_case, result = Core::Test::Result::Unknown.new) ⇒ TestCase

Returns a new instance of TestCase.


24
25
26
27
28
# File 'lib/cucumber/running_test_case.rb', line 24

def initialize(test_case, result = Core::Test::Result::Unknown.new)
  @test_case = test_case
  @result = result
  super test_case
end

Instance Method Details

#accept_hook?(hook) ⇒ Boolean

Returns:

  • (Boolean)

30
31
32
# File 'lib/cucumber/running_test_case.rb', line 30

def accept_hook?(hook)
  hook.tag_expressions.all? { |expression| @test_case.match_tags?(expression) }
end

#exceptionObject


34
35
36
37
# File 'lib/cucumber/running_test_case.rb', line 34

def exception
  return unless @result.failed?
  @result.exception
end

#failed?Boolean

Returns:

  • (Boolean)

43
44
45
# File 'lib/cucumber/running_test_case.rb', line 43

def failed?
  @result.failed?
end

#passed?Boolean

Returns:

  • (Boolean)

47
48
49
# File 'lib/cucumber/running_test_case.rb', line 47

def passed?
  !failed?
end

#source_tag_namesObject


51
52
53
# File 'lib/cucumber/running_test_case.rb', line 51

def source_tag_names
  tags.map &:name
end

#statusObject


39
40
41
# File 'lib/cucumber/running_test_case.rb', line 39

def status
  @result.to_sym
end

#with_result(result) ⇒ Object


55
56
57
# File 'lib/cucumber/running_test_case.rb', line 55

def with_result(result)
  self.class.new(@test_case, result)
end