Class: Cucumber::Runtime
- Inherits:
-
Object
show all
- 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
#visitor
Instance Method Summary
collapse
#ask, #embed, #puts
#format_duration
Constructor Details
#initialize(configuration = Configuration.default) ⇒ Runtime
Returns a new instance of Runtime.
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
42
43
44
|
# File 'lib/cucumber/runtime.rb', line 42
def configuration
@configuration
end
|
Returns the value of attribute results.
42
43
44
|
# File 'lib/cucumber/runtime.rb', line 42
def results
@results
end
|
#support_code ⇒ Object
Returns the value of attribute support_code.
42
43
44
|
# File 'lib/cucumber/runtime.rb', line 42
def support_code
@support_code
end
|
Instance Method Details
#begin_scenario(scenario) ⇒ Object
101
102
103
|
# File 'lib/cucumber/runtime.rb', line 101
def begin_scenario(scenario)
@support_code.fire_hook(:begin_scenario, scenario)
end
|
Allows you to take an existing runtime and change its configuration
55
56
57
58
|
# File 'lib/cucumber/runtime.rb', line 55
def configure(new_configuration)
@configuration = Configuration.parse(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
.
115
116
117
118
|
# File 'lib/cucumber/runtime.rb', line 115
def doc_string(string_without_triple_quotes, content_type='', line_offset=0)
location = Core::Ast::Location.of_caller
Core::Ast::DocString.new(string_without_triple_quotes, content_type, location)
end
|
#dry_run? ⇒ Boolean
77
78
79
|
# File 'lib/cucumber/runtime.rb', line 77
def dry_run?
@configuration.dry_run?
end
|
#end_scenario(scenario) ⇒ Object
105
106
107
|
# File 'lib/cucumber/runtime.rb', line 105
def end_scenario(scenario)
@support_code.fire_hook(:end_scenario)
end
|
#failure? ⇒ Boolean
203
204
205
206
207
208
209
210
|
# File 'lib/cucumber/runtime.rb', line 203
def failure?
if @configuration.wip?
summary_report.test_cases.total_passed > 0
else
summary_report.test_cases.total_failed > 0 || summary_report.test_steps.total_failed > 0 ||
(@configuration.strict? && (summary_report.test_steps.total_undefined > 0 || summary_report.test_steps.total_pending > 0))
end
end
|
#features_paths ⇒ Object
73
74
75
|
# File 'lib/cucumber/runtime.rb', line 73
def features_paths
@configuration.paths
end
|
#load_programming_language(language) ⇒ Object
60
61
62
|
# File 'lib/cucumber/runtime.rb', line 60
def load_programming_language(language)
@support_code.load_programming_language(language)
end
|
64
65
66
67
68
69
70
71
|
# File 'lib/cucumber/runtime.rb', line 64
def run!
load_step_definitions
fire_after_configuration_hook
self.visitor = report
receiver = Test::Runner.new(report)
compile features, receiver, filters
end
|
#scenarios(status = nil) ⇒ Object
81
82
83
|
# File 'lib/cucumber/runtime.rb', line 81
def scenarios(status = nil)
@results.scenarios(status)
end
|
#snippet_text(step_keyword, step_name, multiline_arg) ⇒ Object
97
98
99
|
# File 'lib/cucumber/runtime.rb', line 97
def snippet_text(step_keyword, step_name, multiline_arg) @support_code.snippet_text(::Gherkin::I18n.code_keyword_for(step_keyword), step_name, multiline_arg)
end
|
#step_match(step_name, name_to_report = nil) ⇒ Object
89
90
91
|
# File 'lib/cucumber/runtime.rb', line 89
def step_match(step_name, name_to_report=nil) @support_code.step_match(step_name, name_to_report)
end
|
#steps(status = nil) ⇒ Object
85
86
87
|
# File 'lib/cucumber/runtime.rb', line 85
def steps(status = nil)
@results.steps(status)
end
|
#unknown_programming_language? ⇒ Boolean
109
110
111
|
# File 'lib/cucumber/runtime.rb', line 109
def unknown_programming_language?
@support_code.unknown_programming_language?
end
|
#unmatched_step_definitions ⇒ Object
93
94
95
|
# File 'lib/cucumber/runtime.rb', line 93
def unmatched_step_definitions
@support_code.unmatched_step_definitions
end
|