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
38
# File 'lib/cucumber/running_test_case.rb', line 34

def exception
  return unless @result.failed?

  @result.exception
end

#failed?Boolean

Returns:

  • (Boolean)


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

def failed?
  @result.failed?
end

#passed?Boolean

Returns:

  • (Boolean)


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

def passed?
  !failed?
end

#source_tag_namesObject



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

def source_tag_names
  tags.map(&:name)
end

#statusObject



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

def status
  @result.to_sym
end

#with_result(result) ⇒ Object



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

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