Module: Ardb::TestHelpers
Instance Method Summary collapse
- #connect_db ⇒ Object
- #connect_db! ⇒ Object
- #create_db ⇒ Object
- #create_db! ⇒ Object
- #drop_db ⇒ Object
- #drop_db! ⇒ Object
- #drop_tables ⇒ Object
- #load_schema ⇒ Object
- #migrate_db ⇒ Object
- #migrate_db! ⇒ Object
- #reset_db ⇒ Object
- #reset_db! ⇒ Object
Instance Method Details
#connect_db ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/ardb/test_helpers.rb', line 49 def connect_db @connect_db ||= begin connect_db! true end end |
#connect_db! ⇒ Object
45 46 47 |
# File 'lib/ardb/test_helpers.rb', line 45 def connect_db! Ardb.adapter.connect_db end |
#create_db ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/ardb/test_helpers.rb', line 25 def create_db @create_db ||= begin create_db! true end end |
#create_db! ⇒ Object
21 22 23 |
# File 'lib/ardb/test_helpers.rb', line 21 def create_db! Ardb.adapter.create_db end |
#drop_db ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/ardb/test_helpers.rb', line 37 def drop_db @drop_db ||= begin drop_db! true end end |
#drop_db! ⇒ Object
33 34 35 |
# File 'lib/ardb/test_helpers.rb', line 33 def drop_db! Ardb.adapter.drop_db end |
#drop_tables ⇒ Object
13 14 15 |
# File 'lib/ardb/test_helpers.rb', line 13 def drop_tables Ardb.adapter.drop_tables end |
#load_schema ⇒ Object
17 18 19 |
# File 'lib/ardb/test_helpers.rb', line 17 def load_schema Ardb.adapter.load_schema end |
#migrate_db ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/ardb/test_helpers.rb', line 61 def migrate_db @migrate_db ||= begin migrate_db! true end end |
#migrate_db! ⇒ Object
57 58 59 |
# File 'lib/ardb/test_helpers.rb', line 57 def migrate_db! Ardb.adapter.migrate_db end |
#reset_db ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/ardb/test_helpers.rb', line 75 def reset_db @reset_db ||= begin reset_db! true end end |
#reset_db! ⇒ Object
69 70 71 72 73 |
# File 'lib/ardb/test_helpers.rb', line 69 def reset_db! drop_db! create_db! load_schema end |