Class: Cucumber::Runtime
- Inherits:
-
Object
- Object
- Cucumber::Runtime
- Includes:
- Core, Formatter::Duration, UserInterface
- Defined in:
- lib/cucumber/runtime.rb,
lib/cucumber/runtime/step_hooks.rb,
lib/cucumber/runtime/after_hooks.rb,
lib/cucumber/runtime/before_hooks.rb,
lib/cucumber/runtime/support_code.rb,
lib/cucumber/runtime/user_interface.rb,
lib/cucumber/runtime/for_programming_languages.rb
Defined Under Namespace
Modules: UserInterface Classes: AfterHooks, BeforeHooks, ForProgrammingLanguages, NormalisedEncodingFile, StepHooks, SupportCode
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#support_code ⇒ Object
readonly
Returns the value of attribute support_code.
Attributes included from UserInterface
Instance Method Summary collapse
- #begin_scenario(test_case) ⇒ Object
-
#configure(new_configuration) ⇒ Object
Allows you to take an existing runtime and change its configuration.
-
#doc_string(string_without_triple_quotes, content_type = '', _line_offset = 0) ⇒ Object
Returns Ast::DocString for
string_without_triple_quotes
. - #dry_run? ⇒ Boolean
- #end_scenario(_scenario) ⇒ Object
- #failure? ⇒ Boolean
- #features_paths ⇒ Object
-
#initialize(configuration = Configuration.default) ⇒ Runtime
constructor
A new instance of Runtime.
- #run! ⇒ Object
- #unmatched_step_definitions ⇒ Object
Methods included from UserInterface
Methods included from Formatter::Duration
Constructor Details
#initialize(configuration = Configuration.default) ⇒ Runtime
Returns a new instance of Runtime.
55 56 57 58 |
# File 'lib/cucumber/runtime.rb', line 55 def initialize(configuration = Configuration.default) @configuration = Configuration.new(configuration) @support_code = SupportCode.new(self, @configuration) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration
49 50 51 |
# File 'lib/cucumber/runtime.rb', line 49 def configuration @configuration end |
#results ⇒ Object (readonly)
Returns the value of attribute results
49 50 51 |
# File 'lib/cucumber/runtime.rb', line 49 def results @results end |
#support_code ⇒ Object (readonly)
Returns the value of attribute support_code
49 50 51 |
# File 'lib/cucumber/runtime.rb', line 49 def support_code @support_code end |
Instance Method Details
#begin_scenario(test_case) ⇒ Object
95 96 97 |
# File 'lib/cucumber/runtime.rb', line 95 def begin_scenario(test_case) @support_code.fire_hook(:begin_scenario, test_case) end |
#configure(new_configuration) ⇒ Object
Allows you to take an existing runtime and change its configuration
61 62 63 64 |
# File 'lib/cucumber/runtime.rb', line 61 def configure(new_configuration) @configuration = Configuration.new(new_configuration) @support_code.configure(@configuration) end |
#doc_string(string_without_triple_quotes, content_type = '', _line_offset = 0) ⇒ Object
Returns Ast::DocString for string_without_triple_quotes
.
105 106 107 |
# File 'lib/cucumber/runtime.rb', line 105 def doc_string(string_without_triple_quotes, content_type = '', _line_offset = 0) Core::Test::DocString.new(string_without_triple_quotes, content_type) end |
#dry_run? ⇒ Boolean
87 88 89 |
# File 'lib/cucumber/runtime.rb', line 87 def dry_run? @configuration.dry_run? end |
#end_scenario(_scenario) ⇒ Object
99 100 101 |
# File 'lib/cucumber/runtime.rb', line 99 def end_scenario(_scenario) @support_code.fire_hook(:end_scenario) end |
#failure? ⇒ Boolean
214 215 216 217 218 219 220 |
# File 'lib/cucumber/runtime.rb', line 214 def failure? if @configuration.wip? summary_report.test_cases.total_passed > 0 else !summary_report.ok?(@configuration.strict) end end |
#features_paths ⇒ Object
83 84 85 |
# File 'lib/cucumber/runtime.rb', line 83 def features_paths @configuration.paths end |
#run! ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/cucumber/runtime.rb', line 67 def run! @configuration.notify :envelope, Cucumber::Messages::Envelope.new( meta: Cucumber::CreateMeta.('cucumber-ruby', Cucumber::VERSION) ) load_step_definitions install_wire_plugin fire_after_configuration_hook # TODO: can we remove this state? self.visitor = report receiver = Test::Runner.new(@configuration.event_bus) compile features, receiver, filters, @configuration.event_bus @configuration.notify :test_run_finished end |
#unmatched_step_definitions ⇒ Object
91 92 93 |
# File 'lib/cucumber/runtime.rb', line 91 def unmatched_step_definitions @support_code.unmatched_step_definitions end |