Module: CucumberTree::Handler::Database

Defined in:
lib/cucumber_tree/handlers/database.rb,
lib/cucumber_tree/handlers/databases/sqlite.rb,
lib/cucumber_tree/handlers/databases/postgresql.rb

Defined Under Namespace

Classes: Postgresql, Sqlite

Class Method Summary collapse

Class Method Details

.get_handlerObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/cucumber_tree/handlers/database.rb', line 9

def self.get_handler
  @get_handler ||= begin
    adapter = Rails.configuration.database_configuration[Rails.env]["adapter"]
    case adapter
    when /sqlite/
      Sqlite
    when /postgresql/
      Postgresql
    else
      raise "Database not supported: #{adapter}"
    end
  end
end