Class: Cucumber::RunningTestCase::Scenario
- Defined in:
- lib/cucumber/running_test_case.rb
Direct Known Subclasses
Instance Method Summary collapse
- #accept_hook?(hook) ⇒ Boolean
- #exception ⇒ Object
- #failed? ⇒ Boolean
-
#initialize(test_case, result = Core::Test::Result::Unknown.new) ⇒ Scenario
constructor
A new instance of Scenario.
- #outline? ⇒ Boolean
- #passed? ⇒ Boolean
- #skip_invoke! ⇒ Object
- #source_tag_names ⇒ Object
- #source_tags ⇒ Object
- #status ⇒ Object
- #title ⇒ Object
- #with_result(result) ⇒ Object
Constructor Details
#initialize(test_case, result = Core::Test::Result::Unknown.new) ⇒ Scenario
Returns a new instance of Scenario.
56 57 58 59 60 |
# File 'lib/cucumber/running_test_case.rb', line 56 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
62 63 64 |
# File 'lib/cucumber/running_test_case.rb', line 62 def accept_hook?(hook) hook.tag_expressions.all? { |expression| @test_case.(expression) } end |
#exception ⇒ Object
66 67 68 69 |
# File 'lib/cucumber/running_test_case.rb', line 66 def exception return unless @result.failed? @result.exception end |
#failed? ⇒ Boolean
75 76 77 |
# File 'lib/cucumber/running_test_case.rb', line 75 def failed? @result.failed? end |
#outline? ⇒ Boolean
111 112 113 |
# File 'lib/cucumber/running_test_case.rb', line 111 def outline? false end |
#passed? ⇒ Boolean
79 80 81 |
# File 'lib/cucumber/running_test_case.rb', line 79 def passed? !failed? end |
#skip_invoke! ⇒ Object
103 104 105 106 107 108 109 |
# File 'lib/cucumber/running_test_case.rb', line 103 def skip_invoke! Cucumber.deprecate( "Call #skip_this_scenario directly (not on any object)", "RunningTestCase#skip_invoke!", "2.9.9") raise Cucumber::Core::Test::Result::Skipped end |
#source_tag_names ⇒ Object
99 100 101 |
# File 'lib/cucumber/running_test_case.rb', line 99 def source_tag_names .map &:name end |
#source_tags ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/cucumber/running_test_case.rb', line 91 def Cucumber.deprecate( "Call #tags instead", "RunningTestCase#source_tags", "2.9.9") end |
#status ⇒ Object
71 72 73 |
# File 'lib/cucumber/running_test_case.rb', line 71 def status @result.to_sym end |
#title ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/cucumber/running_test_case.rb', line 83 def title Cucumber.deprecate( "Call #name instead", "RunningTestCase#title", "2.9.9") name end |
#with_result(result) ⇒ Object
115 116 117 |
# File 'lib/cucumber/running_test_case.rb', line 115 def with_result(result) self.class.new(@test_case, result) end |