Sha256: 8c9b1f516834d8556e7ec03293f72d31144b54bccdc5269c67e6e7e7e4ad1fe2
Contents?: true
Size: 1.15 KB
Versions: 9
Compression:
Stored size: 1.15 KB
Contents
#!/usr/bin/env ruby def create_feature_file(name) opts = { name: camelize(name) } template('feature', File.join(FileUtils.pwd, 'features', 'specs', "#{name.downcase}.feature"), opts) end def create_steps_file(name) opts = { name: camelize(name) } template('steps', File.join(FileUtils.pwd, 'features', 'steps_definitions', "#{name.downcase}_steps.rb"), opts) end def create_page_file(name) opts = { name: camelize(name) } template('page', File.join(FileUtils.pwd, 'features/support', 'pages', "#{name.downcase}_page.rb"), opts) end def create_service_file(name) opts = { name: camelize(name) } template('services', File.join(FileUtils.pwd, 'features/support', 'services', "#{name.downcase}_services.rb"), opts) end def camelize(string) camelized = '' string.split('_').each do |s| camelized += s.capitalize end camelized end def in_root_project_folder? unless Dir.exist?(File.join(FileUtils.pwd, 'features', 'specs')) puts 'Please run this command on the root folder of the project' exist 1 end true end
Version data entries
9 entries across 8 versions & 1 rubygems