Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 16af1209d9
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (40 sloc) 1.256 kB
require 'bundler'
require 'bundler/setup'
Bundler::GemHelper.install_tasks
require 'rdoc/task'
require 'rspec'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
task :cleanup_rcov_files do
rm_rf 'coverage.data'
end
desc "Run all examples"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w[--color]
end
Cucumber::Rake::Task.new(:cucumber)
# for cucumber features that create a sample project
def in_example_app(command)
Dir.chdir("./tmp/example_app/") do
Bundler.clean_system command
end
end
namespace :generate do
desc "generate a fresh app with rspec installed"
task :app do |t|
raise 'Bundler 1.1 is a development dependency to build ammeter. Please upgrade bundler.' unless Bundler::VERSION >= '1.1'
sh "bundle exec rails new ./tmp/example_app -m 'features/templates/generate_example_app.rb' --skip-test-unit"
sh "cp 'features/templates/rspec.rake' ./tmp/example_app/lib/tasks"
in_example_app 'rake db:migrate'
in_example_app 'rails g rspec:install'
in_example_app 'bundle install'
end
end
namespace :clobber do
desc "clobber the generated app"
task :app do
rm_rf "tmp/example_app"
end
end
task :ci => [:spec, :'clobber:app', :'generate:app', :cucumber]
task :default => :ci
Jump to Line
Something went wrong with that request. Please try again.