Sha256: 2645f5956836a1fb2223154d2ca35baaf5c13c9edd206c01be500f1ae68acaea

Contents?: true

Size: 1007 Bytes

Versions: 10

Compression:

Stored size: 1007 Bytes

Contents

require 'lib/databasion'

Given /a chunk of (.*) data/ do |name|
  @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'}]
  }
end

When /we parse it/ do
  Databasion::Yamalize.yamlbate(@parse_data, @config['output']['yaml_path'])
end

Then /it should create a relevant YAML file/ do
  File.exist?("%s/%s.yml" % [@config['output']['yaml_path'], @parse_data['name']]).should == true
end

And /should contain the correct data/ do
  data = YAML.load(File.open("%s/%s.yml" % [@config['output']['yaml_path'], @parse_data['name']]))
  data.should include('meta')
  data.should include('data')
  data['meta'].should include('connection')
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
databasion-0.1.0 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.9 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.8 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.7 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.6 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.5 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.4 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.3 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.2 features/databasion/step_definitions/yamalize_steps.rb
databasion-0.0.1 features/databasion/step_definitions/yamalize_steps.rb