-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
29 lines (24 loc) · 1011 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
rspec_gem_dir = nil
Dir["#{File.dirname(__FILE__)}/../../gems/*"].each do |subdir|
rspec_gem_dir = subdir if subdir.gsub("#{File.dirname(__FILE__)}/../../gems/","") =~ /^(\w+-)?rspec-(\d+)/ && File.exist?("#{subdir}/lib/spec/rake/spectask.rb")
end
rspec_plugin_dir = File.expand_path(File.dirname(__FILE__) + '/../rspec')
if rspec_gem_dir && (test ?d, rspec_plugin_dir)
raise "\n#{'*'*50}\nYou have rspec installed in both vendor/gems and vendor/plugins\nPlease pick one and dispose of the other.\n#{'*'*50}\n\n"
end
if rspec_gem_dir
$:.unshift("#{rspec_gem_dir}/lib")
elsif File.exist?(rspec_plugin_dir)
$:.unshift("#{rspec_plugin_dir}/lib")
end
require 'rake'
require 'spec/rake/spectask'
desc 'Default: run specs.'
task :default => :spec
desc 'Run the specs'
Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_opts = ['--exclude "spec/*,gems/*"', '--rails']
end