Class: CucumberGenerator

Inherits:
Generator
  • Object
show all
Defined in:
lib/generators/cucumber/cucumber_generator.rb

Instance Method Summary collapse

Methods inherited from Generator

#android?, #args, #axe?, #cross_platform?, #cucumber?, #ios?, #mobile?, #rspec?, #selenium?, #selenium_based?, #single_platform?, source_paths, #visual?, #watir?, #web?

Instance Method Details

#generate_cucumber_fileObject



26
27
28
# File 'lib/generators/cucumber/cucumber_generator.rb', line 26

def generate_cucumber_file
  template('cucumber.tt', "#{name}/cucumber.yml")
end

#generate_env_fileObject



18
19
20
# File 'lib/generators/cucumber/cucumber_generator.rb', line 18

def generate_env_file
  template('env.tt', "#{name}/features/support/env.rb")
end

#generate_featureObject



6
7
8
# File 'lib/generators/cucumber/cucumber_generator.rb', line 6

def generate_feature
  template('feature.tt', "#{name}/features/#{template_name}.feature")
end

#generate_stepsObject



10
11
12
# File 'lib/generators/cucumber/cucumber_generator.rb', line 10

def generate_steps
  template('steps.tt', "#{name}/features/step_definitions/#{template_name}_steps.rb")
end

#generate_user_factoryObject



14
15
16
# File 'lib/generators/cucumber/cucumber_generator.rb', line 14

def generate_user_factory
  template('user_factory.tt', "#{name}/models/user_factory.rb")
end

#generate_worldObject



22
23
24
# File 'lib/generators/cucumber/cucumber_generator.rb', line 22

def generate_world
  template('world.tt', "#{name}/features/support/world.rb")
end

#template_nameObject



30
31
32
# File 'lib/generators/cucumber/cucumber_generator.rb', line 30

def template_name
  @template_name ||= (@_initializer.first & %w[android ios cross_platform]).empty? ? 'login' : 'home'
end