class Cucumber::ThinkingSphinx::InternalWorld

Attributes

adapter[RW]
database[RW]
database_file[RW]
fixtures_directory[RW]
host[RW]
migrations_directory[RW]
models_directory[RW]
password[RW]
temporary_directory[RW]
username[RW]

Public Class Methods

new() click to toggle source
# File lib/cucumber/thinking_sphinx/internal_world.rb, line 11
def initialize
  pwd = Dir.pwd
  @temporary_directory  = "#{pwd}/tmp"
  @migrations_directory = "#{pwd}/features/thinking_sphinx/db/migrations"
  @models_directory     = "#{pwd}/features/thinking_sphinx/models"
  @fixtures_directory   = "#{pwd}/features/thinking_sphinx/db/fixtures"
  @database_file        = "#{pwd}/features/thinking_sphinx/database.yml"

  @adapter  = (ENV['DATABASE'] || 'mysql').gsub %r^mysql$/, 'mysql2'
  @database = 'thinking_sphinx'
  @username = ENV['USER']
  @host     = 'localhost'

  if @adapter[%rmysql/]
    @username = 'root'
  elsif ENV['TRAVIS']
    @username = 'postgres'
  end
end

Public Instance Methods

configure_database() click to toggle source
# File lib/cucumber/thinking_sphinx/internal_world.rb, line 44
def configure_database
  ActiveRecord::Base.establish_connection database_settings
  self
end
setup() click to toggle source
# File lib/cucumber/thinking_sphinx/internal_world.rb, line 31
def setup
  make_temporary_directory

  configure_cleanup
  configure_thinking_sphinx
  configure_active_record

  prepare_data
  setup_sphinx

  self
end