Module: Cucumber::Generators::FeatureBase
- Included in:
- FeatureGenerator
- Defined in:
- lib/generators/cucumber/feature/feature_base.rb
Instance Method Summary collapse
- #create_directory(m = self, rails2 = false) ⇒ Object
- #create_feature_file(m = self) ⇒ Object
- #create_steps_file(m = self) ⇒ Object
- #create_support_file(m = self) ⇒ Object
Instance Method Details
#create_directory(m = self, rails2 = false) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/generators/cucumber/feature/feature_base.rb', line 5 def create_directory(m = self, rails2 = false) if rails2 m.directory 'features/step_definitions' else m.empty_directory 'features/step_definitions' end end |
#create_feature_file(m = self) ⇒ Object
13 14 15 |
# File 'lib/generators/cucumber/feature/feature_base.rb', line 13 def create_feature_file(m = self) m.template 'feature.erb', "features/manage_#{plural_name}.feature" end |
#create_steps_file(m = self) ⇒ Object
17 18 19 |
# File 'lib/generators/cucumber/feature/feature_base.rb', line 17 def create_steps_file(m = self) m.template 'steps.erb', "features/step_definitions/#{singular_name}_steps.rb" end |
#create_support_file(m = self) ⇒ Object
21 22 23 24 25 |
# File 'lib/generators/cucumber/feature/feature_base.rb', line 21 def create_support_file(m = self) m.gsub_file 'features/support/paths.rb', /'\/'/mi do |match| "#{match}\n when /the new #{singular_name} page/\n new_#{singular_name}_path\n" end end |