Class: VisibleCukes
- Inherits:
-
Cucumber::Formatter::Html
- Object
- Cucumber::Formatter::Html
- VisibleCukes
- Defined in:
- lib/visible_cukes.rb
Instance Method Summary collapse
-
#initialize(step_mother, io, options) ⇒ VisibleCukes
constructor
A new instance of VisibleCukes.
- #visit_feature_name(name) ⇒ Object
- #visit_step(step) ⇒ Object
Constructor Details
#initialize(step_mother, io, options) ⇒ VisibleCukes
Returns a new instance of VisibleCukes.
51 52 53 54 55 |
# File 'lib/visible_cukes.rb', line 51 def initialize(step_mother, io, ) super(step_mother, io, ) @rb = step_mother.load_programming_language('rb') end |
Instance Method Details
#visit_feature_name(name) ⇒ Object
57 58 59 60 61 |
# File 'lib/visible_cukes.rb', line 57 def visit_feature_name(name) super(name) @current_page_name_prefix = name.split(/\r?\n/)[0].downcase.gsub(/\s+/, '_').gsub(/[^a-z_]/, '') @current_page_name_count = 1 end |
#visit_step(step) ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'lib/visible_cukes.rb', line 63 def visit_step(step) @step_id = step.dom_id html_filename = "feature_pages/#{@current_page_name_prefix}_#{@current_page_name_count}.html" @current_page_name_count += 1 @builder.a(:href => html_filename) do super end save_file html_filename end |