- `rake spec' no longer installs dependencies
  - no shelling out
  - removed unused code
  - single Rakefile

Change-Id: I538674d0649d9ad24060a950c671fadd01eac148
This commit is contained in:
Jesse Zhang 2012-02-29 14:40:27 -08:00
Родитель 0580179d18
Коммит b554cefd68
2 изменённых файлов: 13 добавлений и 47 удалений

Просмотреть файл

@ -1,32 +1,18 @@
require 'rake'
require 'rubygems/package_task'
require 'rspec/core/rake_task'
require 'ci/reporter/rake/rspec'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
require 'vcap/staging/version'
Gem::PackageTask.new(Gem::Specification.load('vcap_staging.gemspec')).define
task :build do
sh "gem build vcap_staging.gemspec"
desc "build gem"
task :build => :gem
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/**/*_spec.rb'
t.rspec_opts = ['--color', '--format nested']
end
task :spec => ['bundler:install:test'] do
desc 'Run tests'
sh('cd spec && rake spec')
end
task :default => [:spec]
task 'ci:spec' do
desc 'Run tests for CI'
sh('cd spec && rake ci:spec')
end
namespace 'bundler' do
task 'install' do
sh('bundle install')
end
environments = %w(test development production)
environments.each do |env|
desc "Install gems for #{env}"
task "install:#{env}" do
sh("bundle install --local --without #{(environments - [env]).join(' ')}")
end
end
end
desc 'Run tests for CI'
task 'ci:spec' => ['ci:setup:rspec', :spec]

Просмотреть файл

@ -1,20 +0,0 @@
require 'rake'
BASE_DIR = File.expand_path(File.join('..', '..'), __FILE__)
ENV["BUNDLE_GEMFILE"] ||= File.join(BASE_DIR, 'Gemfile')
require 'rubygems'
require 'bundler'
Bundler.setup(:default, :test)
require 'rspec/core/rake_task'
require 'ci/reporter/rake/rspec'
ENV['CI_REPORTS'] = File.expand_path('reports', File.dirname(__FILE__))
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = '**/*_spec.rb'
t.rspec_opts = ['--color', '--format nested']
end
task :default => [:spec]
task 'ci:spec' => ['ci:setup:rspec', :spec]