Class: Cukestart::Generator::Structure

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/cukestart/generator/structure.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



11
12
13
# File 'lib/cukestart/generator/structure.rb', line 11

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#copy_cucumber_ymlObject



23
24
25
# File 'lib/cukestart/generator/structure.rb', line 23

def copy_cucumber_yml
  copy_file('files/cucumber.yml', "#{project_name}/cucumber.yml")
end

#create_capybaraObject



35
36
37
38
# File 'lib/cukestart/generator/structure.rb', line 35

def create_capybara
  template('templates/capybara.tt',
          "#{project_name}/features/support/capybara.rb") if front
end

#create_envObject



31
32
33
# File 'lib/cukestart/generator/structure.rb', line 31

def create_env
  template('templates/env.tt', "#{project_name}/features/support/env.rb")
end

#create_foldersObject



15
16
17
18
19
20
21
# File 'lib/cukestart/generator/structure.rb', line 15

def create_folders
  empty_directory(project_name)
  empty_directory("#{project_name}/features")
  empty_directory("#{project_name}/features/support")
  empty_directory("#{project_name}/features/step_definitions")
  empty_directory("#{project_name}/features/pages") if page_object
end

#create_gemfileObject



27
28
29
# File 'lib/cukestart/generator/structure.rb', line 27

def create_gemfile
  template('templates/gemfile.tt', "#{project_name}/Gemfile")
end