Class: Cucumber::FeatureGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Cucumber::FeatureGenerator
- Defined in:
- lib/generators/cucumber/feature/feature_generator.rb
Instance Attribute Summary collapse
-
#named_args ⇒ Object
readonly
Returns the value of attribute named_args.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#named_args ⇒ Object (readonly)
Returns the value of attribute named_args.
9 10 11 |
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 9 def named_args @named_args end |
Class Method Details
.banner ⇒ Object
24 25 26 |
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 24 def self. "#{$0} cucumber:feature ModelName [field:type, field:type]" end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/generators/cucumber/feature/feature_generator.rb', line 15 def generate empty_directory 'features/step_definitions' template 'feature.erb', "features/manage_#{plural_name}.feature" template 'steps.erb', "features/step_definitions/#{singular_name}_steps.rb" 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 |