Class: CucumberTree::Handler::Database::Sqlite

Inherits:
Base
  • Object
show all
Defined in:
lib/cucumber_tree/handlers/databases/sqlite.rb

Instance Attribute Summary

Attributes inherited from Base

#scenario, #world

Instance Method Summary collapse

Methods inherited from Base

#page

Instance Method Details

#load(snapshot) ⇒ Object



7
8
9
# File 'lib/cucumber_tree/handlers/databases/sqlite.rb', line 7

def load(snapshot)
  FileUtils.cp(snapshot[:sqlite_file], db_file)
end

#save(snapshot) ⇒ Object



11
12
13
14
15
# File 'lib/cucumber_tree/handlers/databases/sqlite.rb', line 11

def save(snapshot)
  dump_file = ::CucumberTree::TempDir.file_name("dbfile.sqlite")
  FileUtils.cp(db_file, dump_file)
  snapshot[:sqlite_file] = dump_file
end