module Swat::Capybara::RspecSetup

Public Instance Methods

init_capybara(rspec_config) click to toggle source
# File lib/swat/capybara/rspec_setup.rb, line 62
def init_capybara(rspec_config)
  # adds possiblity to create helpers automatically required and extended by a convention
  def require_specific_helper(current_file, context)
    parts = current_file.split('/')
    parts[-1] = 'specific_helper'
    path = parts*'/'
    require path
    context.extend eval('SpecificHelper')
  end
end
require_specific_helper(current_file, context) click to toggle source

adds possiblity to create helpers automatically required and extended by a convention

# File lib/swat/capybara/rspec_setup.rb, line 64
def require_specific_helper(current_file, context)
  parts = current_file.split('/')
  parts[-1] = 'specific_helper'
  path = parts*'/'
  require path
  context.extend eval('SpecificHelper')
end