rails_generators/cucumber/cucumber_generator.rb in aslakhellesoy-cucumber-0.3.9.4 vs rails_generators/cucumber/cucumber_generator.rb in aslakhellesoy-cucumber-0.3.9.5

- old
+ new

@@ -17,15 +17,21 @@ m.gsub_file 'config/database.yml', /test:.*\n/, "test: &TEST\n" m.gsub_file 'config/database.yml', /\z/, "\ncucumber:\n <<: *TEST" m.directory 'features/support' - m.template 'env.rb', 'features/support/env.rb' + + if options[:spork] + m.template 'spork_env.rb', 'features/support/env.rb' + else + m.template 'env.rb', 'features/support/env.rb' + end + m.file 'paths.rb', 'features/support/paths.rb' m.directory 'lib/tasks' - m.file 'cucumber.rake', 'lib/tasks/cucumber.rake' + m.template 'cucumber.rake', 'lib/tasks/cucumber.rake' m.file 'cucumber', 'script/cucumber', { :chmod => 0755, :shebang => options[:shebang] == DEFAULT_SHEBANG ? nil : options[:shebang] } end @@ -48,9 +54,13 @@ options[:framework] = :rspec end opt.on('--testunit', 'Setup cucumber for use with test/unit') do |value| options[:framework] = :testunit + end + + opt.on('--spork', 'Setup cucumber for use with Spork') do |value| + options[:spork] = true end end end