Class: Cucumber::RunningTestCase::TestCase
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Cucumber::RunningTestCase::TestCase
- Defined in:
- lib/cucumber/running_test_case.rb
Instance Method Summary collapse
- #accept_hook?(hook) ⇒ Boolean
- #exception ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(test_case, result = Core::Test::Result::Unknown.new) ⇒ TestCase
constructor
A new instance of TestCase.
- #passed? ⇒ Boolean
- #source_tag_names ⇒ Object
- #status ⇒ Object
- #with_result(result) ⇒ Object
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
30 31 32 |
# File 'lib/cucumber/running_test_case.rb', line 30 def accept_hook?(hook) hook.tag_expressions.all? { |expression| @test_case.(expression) } end |
#exception ⇒ Object
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
44 45 46 |
# File 'lib/cucumber/running_test_case.rb', line 44 def failed? @result.failed? end |
#passed? ⇒ Boolean
48 49 50 |
# File 'lib/cucumber/running_test_case.rb', line 48 def passed? !failed? end |
#source_tag_names ⇒ Object
52 53 54 |
# File 'lib/cucumber/running_test_case.rb', line 52 def source_tag_names .map(&:name) end |
#status ⇒ Object
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 |