module Testimonium::CLI::Create

Create a new test project

Public Instance Methods

parse_create_arguments!() click to toggle source
# File lib/testimonium/cli/create.rb, line 9
def parse_create_arguments!
  Cucumber::ProjectInitializer.new.run

  env_path = File.join(Dir.getwd, 'features', 'support', 'env.rb')

  Kernel.exit(0) unless File.read(env_path).empty?

  env_template_path = File.join(File.dirname(__FILE__), 'templates', 'env.rb.template')
  env_template = File.read(env_template_path)

  File.open(File.join(Dir.getwd, 'features', 'support', 'env.rb'), 'w') do |file|
    file.write(env_template)
  end
end