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.8 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.7 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.6 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.5 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.4 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.3 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.2 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.1 lib/generators/wheels/recipes/cucumber.rb
wheels-0.1.0 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.49 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.48 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.47 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.46 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.45 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.44 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.43 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.42 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.41 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.40 lib/generators/wheels/recipes/cucumber.rb
wheels-0.0.39 lib/generators/wheels/recipes/cucumber.rb