Class: YARD::Handlers::Ruby::StepDefinitionHandler
- Inherits:
-
Base
- Object
- Base
- YARD::Handlers::Ruby::StepDefinitionHandler
- Defined in:
- lib/yard/handlers/step_definition_handler.rb
Overview
Finds and processes all the step definitions defined in the ruby source
Class Method Summary collapse
Instance Method Summary collapse
- #pending_command_statement?(line) ⇒ Boolean
- #pending_keyword ⇒ Object
- #pending_keyword_used?(block) ⇒ Boolean
- #step_definition_name ⇒ Object
- #step_transform_namespace ⇒ Object
Class Method Details
.generate_unique_id ⇒ Object
52 53 54 |
# File 'lib/yard/handlers/step_definition_handler.rb', line 52 def self.generate_unique_id @step_definition_count = @step_definition_count.to_i + 1 end |
Instance Method Details
#pending_command_statement?(line) ⇒ Boolean
35 36 37 |
# File 'lib/yard/handlers/step_definition_handler.rb', line 35 def pending_command_statement?(line) (line.type == :command || line.type == :vcall) && line.first.source == pending_keyword end |
#pending_keyword ⇒ Object
31 32 33 |
# File 'lib/yard/handlers/step_definition_handler.rb', line 31 def pending_keyword "skip" end |
#pending_keyword_used?(block) ⇒ Boolean
39 40 41 42 |
# File 'lib/yard/handlers/step_definition_handler.rb', line 39 def pending_keyword_used?(block) code_in_block = block.last code_in_block.find { |line| pending_command_statement?(line) } end |
#step_definition_name ⇒ Object
48 49 50 |
# File 'lib/yard/handlers/step_definition_handler.rb', line 48 def step_definition_name "step_definition#{self.class.generate_unique_id}" end |
#step_transform_namespace ⇒ Object
44 45 46 |
# File 'lib/yard/handlers/step_definition_handler.rb', line 44 def step_transform_namespace YARD::CodeObjects::Cucumber::CUCUMBER_STEPTRANSFORM_NAMESPACE end |