Class: Cucumber::RunningTestCase::Scenario
- Defined in:
- lib/cucumber/running_test_case.rb
Direct Known Subclasses
Instance Method Summary collapse
- #accept_hook?(hook) ⇒ Boolean
- #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
- #title ⇒ Object
- #with_result(result) ⇒ Object
Constructor Details
#initialize(test_case, result = Core::Test::Result::Unknown.new) ⇒ Scenario
Returns a new instance of Scenario.
55 56 57 58 59 |
# File 'lib/cucumber/running_test_case.rb', line 55 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
61 62 63 |
# File 'lib/cucumber/running_test_case.rb', line 61 def accept_hook?(hook) hook.tag_expressions.all? { |expression| @test_case.(expression) } end |
#failed? ⇒ Boolean
65 66 67 |
# File 'lib/cucumber/running_test_case.rb', line 65 def failed? @result.failed? end |
#outline? ⇒ Boolean
92 93 94 |
# File 'lib/cucumber/running_test_case.rb', line 92 def outline? false end |
#passed? ⇒ Boolean
69 70 71 |
# File 'lib/cucumber/running_test_case.rb', line 69 def passed? !failed? end |
#skip_invoke! ⇒ Object
87 88 89 90 |
# File 'lib/cucumber/running_test_case.rb', line 87 def skip_invoke! Cucumber.deprecate(self.class.name, __method__, "Call #skip_this_scenario on the World directly") raise Cucumber::Core::Test::Result::Skipped end |
#source_tag_names ⇒ Object
83 84 85 |
# File 'lib/cucumber/running_test_case.rb', line 83 def source_tag_names .map &:name end |
#source_tags ⇒ Object
78 79 80 81 |
# File 'lib/cucumber/running_test_case.rb', line 78 def #warn('deprecated: call #tags instead') end |
#title ⇒ Object
73 74 75 76 |
# File 'lib/cucumber/running_test_case.rb', line 73 def title warn("deprecated: call #name instead") name end |
#with_result(result) ⇒ Object
96 97 98 |
# File 'lib/cucumber/running_test_case.rb', line 96 def with_result(result) self.class.new(@test_case, result) end |