-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
56 lines (46 loc) · 1.21 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env rake
require "rubygems"
require "bundler"
Bundler.setup
require "bundler/gem_tasks"
require 'rake/testtask'
begin
require 'berkshelf/version'
rescue LoadError
end
task :info do
sh 'which git'
sh 'git --version'
end
begin
require 'cucumber'
require 'cucumber/rake/task'
desc 'Run Cucumber features'
Cucumber::Rake::Task.new(:features) do |t|
# t.fork = false
t.cucumber_opts = %w{--format progress --exclude features/fixtures}
t.cucumber_opts += %w{--tags ~@berkshelf} unless defined?(Berkshelf)
t.cucumber_opts += ENV['CUCUMBER_OPTS'].split if ENV['CUCUMBER_OPTS']
end
rescue LoadError
desc 'Cucumber rake task not available'
task :features do
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end
desc "Run Minitest specs"
Rake::TestTask.new :spec do |task|
task.libs << 'spec'
task.test_files = FileList['spec/**/*_spec.rb']
end
# https://github.com/jruby/jruby/issues/405
mkdir_p 'tmp'
ENV['TMPDIR'] ||= File.join(Dir.pwd, 'tmp')
task :default => [:info, :spec, :features]
if ENV['COVERAGE']
task :clean_coverage do
rm_rf 'coverage'
end
task :spec => :clean_coverage
task :features => :clean_coverage
end