Module: Ardb::TestHelpers

Defined in:
lib/ardb/test_helpers.rb

Class Method Summary collapse

Class Method Details

.connect_dbObject



46
47
48
49
50
51
# File 'lib/ardb/test_helpers.rb', line 46

def connect_db
  @connect_db ||= begin
    self.connect_db!
    true
  end
end

.connect_db!Object



42
43
44
# File 'lib/ardb/test_helpers.rb', line 42

def connect_db!
  Ardb.adapter.connect_db
end

.create_dbObject



24
25
26
27
28
29
# File 'lib/ardb/test_helpers.rb', line 24

def create_db
  @create_db ||= begin
    self.create_db!
    true
  end
end

.create_db!Object



20
21
22
# File 'lib/ardb/test_helpers.rb', line 20

def create_db!
  Ardb.adapter.create_db
end

.drop_dbObject



35
36
37
38
39
40
# File 'lib/ardb/test_helpers.rb', line 35

def drop_db
  @drop_db ||= begin
    self.drop_db!
    true
  end
end

.drop_db!Object



31
32
33
# File 'lib/ardb/test_helpers.rb', line 31

def drop_db!
  Ardb.adapter.drop_db
end

.drop_tablesObject



12
13
14
# File 'lib/ardb/test_helpers.rb', line 12

def drop_tables
  Ardb.adapter.drop_tables
end

.load_schemaObject



16
17
18
# File 'lib/ardb/test_helpers.rb', line 16

def load_schema
  Ardb.adapter.load_schema
end

.migrate_dbObject



57
58
59
60
61
62
# File 'lib/ardb/test_helpers.rb', line 57

def migrate_db
  @migrate_db ||= begin
    self.migrate_db!
    true
  end
end

.migrate_db!Object



53
54
55
# File 'lib/ardb/test_helpers.rb', line 53

def migrate_db!
  Ardb.adapter.migrate_db
end

.reset_dbObject



70
71
72
73
74
75
# File 'lib/ardb/test_helpers.rb', line 70

def reset_db
  @reset_db ||= begin
    self.reset_db!
    true
  end
end

.reset_db!Object



64
65
66
67
68
# File 'lib/ardb/test_helpers.rb', line 64

def reset_db!
  self.drop_db!
  self.create_db!
  self.load_schema
end