Class: Cucumber::ThinkingSphinx::InternalWorld

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/thinking_sphinx/internal_world.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInternalWorld

Returns a new instance of InternalWorld.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 11

def initialize
  @temporary_directory  = "#{Dir.pwd}/tmp"
  @migrations_directory = "features/support/db/migrations"
  @models_directory     = "features/support/models"
  @fixtures_directory   = "features/support/db/fixtures"
  @database_file        = "features/support/database.yml"
  
  @adapter  = ENV['DATABASE'] || 'mysql'
  @database = 'thinking_sphinx'
  @username = 'thinking_sphinx'
  # @password = 'thinking_sphinx'
  @host     = 'localhost'
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



8
9
10
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 8

def adapter
  @adapter
end

#databaseObject

Returns the value of attribute database.



8
9
10
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 8

def database
  @database
end

#database_fileObject

Returns the value of attribute database_file.



6
7
8
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 6

def database_file
  @database_file
end

#fixtures_directoryObject

Returns the value of attribute fixtures_directory.



6
7
8
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 6

def fixtures_directory
  @fixtures_directory
end

#hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 8

def host
  @host
end

#migrations_directoryObject

Returns the value of attribute migrations_directory.



6
7
8
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 6

def migrations_directory
  @migrations_directory
end

#models_directoryObject

Returns the value of attribute models_directory.



6
7
8
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 6

def models_directory
  @models_directory
end

#passwordObject

Returns the value of attribute password.



8
9
10
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 8

def password
  @password
end

#temporary_directoryObject

Returns the value of attribute temporary_directory.



6
7
8
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 6

def temporary_directory
  @temporary_directory
end

#usernameObject

Returns the value of attribute username.



8
9
10
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 8

def username
  @username
end

Instance Method Details

#configure_databaseObject



38
39
40
41
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 38

def configure_database
  ActiveRecord::Base.establish_connection database_settings
  self
end

#setupObject



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cucumber/thinking_sphinx/internal_world.rb', line 25

def setup
  make_temporary_directory
  
  configure_cleanup
  configure_thinking_sphinx
  configure_active_record
  
  prepare_data
  setup_sphinx
  
  self
end