Fetching contributors…
Cannot retrieve contributors at this time
26 lines (21 sloc) 840 Bytes
def rspec(pattern, format = nil, more_opts = nil, ruby = RUBY, command = 'spec')
format ||= ENV["FORMAT"] || :progress
libs = Dir.glob("{*,.}/lib").join File::PATH_SEPARATOR
files = Dir.glob(pattern).map { |f| f.inspect }.join " "
opts = ["-b -c --format #{format} --loadby mtime --reverse", *more_opts].compact.join " "
command = "bundle exec #{command}" if ENV['BUNDLER']
sh "RUBYLIB=#{libs.strip}:#{ENV['RUBYLIB'].to_s.strip} #{ruby} -S #{command} #{opts} #{files}"
end
pattern = "spec/**/*_spec.rb"
project_namespace :spec do
desc "run specs for %s"
project_task :default => :clobber do |t|
rspec "#{subproject.name}/#{pattern}"
end
end
desc "run all specs"
task(:spec) { rspec "{*,.}/#{pattern}" }
namespace :spec do
desc "run only specs for big_band meta project"
task(:big_band) { rspec pattern }
end