Module: Ardb::TestHelpers

Defined in:
lib/ardb/test_helpers.rb

Class Method Summary collapse

Class Method Details

.connect_dbObject



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

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

.connect_db!Object



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

def connect_db!
  Ardb.adapter.connect_db
end

.create_dbObject



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

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

.create_db!Object



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

def create_db!
  Ardb.adapter.create_db
end

.drop_dbObject



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

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

.drop_db!Object



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

def drop_db!
  Ardb.adapter.drop_db
end

.drop_tablesObject



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

def drop_tables
  Ardb.adapter.drop_tables
end

.load_schemaObject



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

def load_schema
  Ardb.adapter.load_schema
end

.migrate_dbObject



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

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

.migrate_db!Object



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

def migrate_db!
  Ardb.adapter.migrate_db
end

.reset_dbObject



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

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

.reset_db!Object



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

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