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
47 48 49 50 51 52 |
# File 'lib/ardb/test_helpers.rb', line 47 def connect_db @connect_db ||= begin connect_db! true end end |
#connect_db! ⇒ Object
43 44 45 |
# File 'lib/ardb/test_helpers.rb', line 43 def connect_db! Ardb.adapter.connect_db end |
#create_db ⇒ Object
25 26 27 28 29 30 |
# 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
36 37 38 39 40 41 |
# File 'lib/ardb/test_helpers.rb', line 36 def drop_db @drop_db ||= begin drop_db! true end end |
#drop_db! ⇒ Object
32 33 34 |
# File 'lib/ardb/test_helpers.rb', line 32 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
58 59 60 61 62 63 |
# File 'lib/ardb/test_helpers.rb', line 58 def migrate_db @migrate_db ||= begin migrate_db! true end end |
#migrate_db! ⇒ Object
54 55 56 |
# File 'lib/ardb/test_helpers.rb', line 54 def migrate_db! Ardb.adapter.migrate_db end |
#reset_db ⇒ Object
71 72 73 74 75 76 |
# File 'lib/ardb/test_helpers.rb', line 71 def reset_db @reset_db ||= begin reset_db! true end end |
#reset_db! ⇒ Object
65 66 67 68 69 |
# File 'lib/ardb/test_helpers.rb', line 65 def reset_db! drop_db! create_db! load_schema end |