vagrant-lxc-ng/tasks/spec.rake

41 lines
1 KiB
Ruby
Raw Permalink Normal View History

begin
require 'rspec/core/rake_task'
2013-04-20 20:38:01 +00:00
require 'coveralls/rake/task'
desc 'Run all specs'
task :spec => ['spec:set_coverage', 'spec:unit', 'spec:acceptance']
desc 'Default task which runs all specs with code coverage enabled'
task :default => ['spec:set_coverage', 'spec:unit']
2013-04-20 20:38:01 +00:00
Coveralls::RakeTask.new
task :ci => ['spec:set_coverage', 'spec:unit', 'coveralls:push']
rescue LoadError; end
namespace :spec do
task :set_coverage do
ENV['COVERAGE'] = 'true'
end
desc 'Run acceptance specs using vagrant-spec'
task :acceptance do
components = %w(
basic
network/forwarded_port
synced_folder
synced_folder/nfs
synced_folder/rsync
provisioner/shell
provisioner/puppet
provisioner/chef-solo
package
).map{|s| "provider/lxc/#{s}" }
sh "export ACCEPTANCE=true && bundle exec vagrant-spec test --components=#{components.join(' ')}"
end
desc "Run unit specs with rspec"
RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = "./unit/**/*_spec.rb"
end
end