Sha256: f9806440a6e4e20ec56599216b6a1d1d4b92611f8b5e6803d7277e45a0631046

Contents?: true

Size: 1.45 KB

Versions: 75

Compression:

Stored size: 1.45 KB

Contents

gsub_file 'Gemfile', /(gem "rspec-rails".*:group =>) \[:development, :test\]/, '\1 [:development, :test, :cucumber]'
gsub_file 'Gemfile', /(gem "factory_girl_rails".*:group =>) :test/, '\1 [:test, :cucumber]'

append_file 'Gemfile', <<-EOF
group :cucumber do
  gem 'capybara'
  gem 'cucumber-rails'
  gem 'spork'
  gem 'launchy'
end
EOF

stategies <<  lambda do
  generate 'cucumber:install --rspec --capybara --skip-database'

  cukes_factory_girl = <<-END

  require 'factory_girl'
  require 'factory_girl/step_definitions'
  Dir[File.expand_path(File.join(File.dirname(__FILE__),'..','..','spec','factories','*.rb'))].each {|f| require f}

  END
  inject_into_file "features/support/env.rb", cukes_factory_girl, :after => 'ActionController::Base.allow_rescue = false'
  if recipes.include? 'mongoid'
    # Mongoid truncation strategy
    create_file 'features/support/hooks.rb', load_template('features/support/hooks.rb', 'mongoid')

    # Compliment to factory_girl step definitions
    create_file 'features/step_definitions/mongoid_steps.rb', load_template('features/step_definitions/mongoid_steps.rb', 'mongoid')

    # Update mongoid.yml
    mongoid_config_path = 'config/mongoid.yml'
    gsub_file mongoid_config_path, /(test:)/,  '\1 &test'

    inject_into_file mongoid_config_path, load_snippet('database_config', 'cucumber'), :before => '# set these environment variables on your prod server'
    run "cp #{mongoid_config_path} #{mongoid_config_path}.example"
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
wheels-0.1.30 lib/generators/recipes/cucumber.rb
wheels-0.1.28 lib/generators/recipes/cucumber.rb
wheels-0.1.27 lib/generators/recipes/cucumber.rb
wheels-0.1.25 lib/generators/recipes/cucumber.rb
wheels-0.1.24 lib/generators/recipes/cucumber.rb
wheels-0.1.23 lib/generators/recipes/cucumber.rb
wheels-0.1.22 lib/generators/recipes/cucumber.rb
wheels-0.1.21 lib/generators/recipes/cucumber.rb
wheels-0.1.20 lib/generators/recipes/cucumber.rb
wheels-0.1.19 lib/generators/recipes/cucumber.rb
wheels-0.1.18 lib/generators/recipes/cucumber.rb
wheels-0.1.17 lib/generators/recipes/cucumber.rb
wheels-0.1.16 lib/generators/recipes/cucumber.rb
wheels-0.1.15 lib/generators/recipes/cucumber.rb
wheels-0.1.14 lib/generators/recipes/cucumber.rb
wheels-0.1.13 lib/generators/recipes/cucumber.rb
wheels-0.1.12 lib/generators/recipes/cucumber.rb
wheels-0.1.11 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.10 lib/generators/recipes/cucumber.rb
wheels-0.1.9 lib/generators/recipes/cucumber.rb