Sha256: a1d929d998892343705e1eadc9d980947826182ee2ba390fec3a9337d889cf4c

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

Given /^I have a cookbook named "(\w+)" at version "([\d\.]+)"$/ do |name, version|
  create_cookbook(name, version)
end

Given /^I have a cookbook named "(\w+)"$/ do |name|
  create_cookbook(name, '0.0.0')
end

Given /^I have a cookbook named "(\w+)" with git support$/ do |name|
  create_cookbook(name, '0.0.0', git: true)
end


#
# Create a new cookbook with the given name and version.
#
# @param [String] name
# @param [String] version (default: 0.0.0.0)
# @param [Hash] options
#
def create_cookbook(name, version, options = {})
  create_dir(name)
  cd(name)

  write_file('CHANGELOG.md', <<-EOH.gsub(/^ {4}/, ''))
    Changelog
    =========

    v#{version} (#{Time.now.to_date})
    ----------------------------
    - This is an entry
    - This is another entry
  EOH

  write_file('README.md', <<-EOH.gsub(/^ {4}/, ''))
    This is the README for #{name}
  EOH

  write_file('metadata.rb', <<-EOH.gsub(/^ {4}/, ''))
    name    '#{name}'
    version '#{version}'
  EOH

  if options[:git]
    git_init(current_dir)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stove-2.0.0.beta.1 features/step_definitions/cookbook_steps.rb