forked from jarib/celerity
/
rspec.rake
43 lines (36 loc) · 812 Bytes
/
rspec.rake
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
begin
require 'spec'
rescue LoadError
require 'rubygems'
require 'spec'
end
begin
require 'spec/rake/spectask'
rescue LoadError
puts <<-EOS
To use rspec for testing you must install rspec gem:
gem install rspec
EOS
exit(0)
end
if File.exist?(path = "spec/watirspec/watirspec.rake")
load path
end
namespace :watirspec do
desc 'Initialize and fetch the watirspec submodule'
task :init do
sh "git submodule init"
sh "git submodule update"
end
end
desc "Run the specs under spec/"
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
# t.ruby_opts = %w[--headless] if RUBY_PLATFORM =~ /java/
begin
require 'rcov'
t.rcov = true
t.rcov_opts = ['--exclude', 'spec,fcntl,path_helper,yaml', '--no-rcovrt']
rescue LoadError
end
end