Class: Viewcumber

Inherits:
Cucumber::Formatter::Json
  • Object
show all
Includes:
Cucumber010, Cucumber09
Defined in:
lib/viewcumber.rb

Defined Under Namespace

Modules: Cucumber010, Cucumber09

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Cucumber010

#after_feature, #after_step

Methods included from Cucumber09

#after_step

Constructor Details

#initialize(step_mother, path_or_io, options) ⇒ Viewcumber

Returns a new instance of Viewcumber.



76
77
78
79
80
81
# File 'lib/viewcumber.rb', line 76

def initialize(step_mother, path_or_io, options)
  make_output_dir
  copy_app
  copy_public_folder
  super(step_mother, File.open(results_filename, 'w+'), options)
end

Class Attribute Details

.last_step_htmlObject

Returns the value of attribute last_step_html.



63
64
65
# File 'lib/viewcumber.rb', line 63

def last_step_html
  @last_step_html
end

Class Method Details

.rewrite_css_and_image_references(response_html) ⇒ Object

:nodoc:



65
66
67
68
69
70
71
72
73
# File 'lib/viewcumber.rb', line 65

def rewrite_css_and_image_references(response_html) # :nodoc:
  return response_html unless Capybara.asset_root
  directories = Dir.new(Capybara.asset_root).entries.inject([]) do |list, name|
    list << name if File.directory?(File.join(Capybara.asset_root, name)) and not name.to_s =~ /^\./
    list
  end
  response_html.gsub!(/("|')\/(#{directories.join('|')})/, '\1public/\2')
  response_html.gsub(/("|')http:\/\/.*\/images/, '\1public/images') 
end