Sha256: 5a3862783fa484a5ff528193f1fca466e3d1468f3de4355e2d7cdbb25d617c33
Contents?: true
Size: 924 Bytes
Versions: 10
Compression:
Stored size: 924 Bytes
Contents
require 'lib/databasion' Given /a complete set of YAML definitions/ do @config = YAML.load(File.open('config/google.yml')) @parse_data = { 'name' => 'mock', 'plural' => true, 'fields' => ["id", "name", "power"], 'types' => ["integer", "string, 20", "string, 40"], 'data' => [[1, "Brian Jones", "Super Intelligence"], [2, "Superman", "Invincible"], [3, "Batman", "Strength"]], 'ignore_cols' => [2], 'connection' => [{'database' => 'moon'}] } Databasion::Yamalize.yamlbate(@parse_data, @config['output']['yaml_path']) @files = Dir["%s/%s.yml" % [@config['output']['yaml_path'], @parse_data['name']]] end When /the YAML files are parsed/ do Databasion::Migitize.migrabate(@files, @config) end Then /the result is Ruby migration files/ do File.exist?("%s/100_%s.rb" % [@config['output']['migrations']['path'], @parse_data['name']]).should == true end
Version data entries
10 entries across 10 versions & 1 rubygems