forked from chefspec/chefspec
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
35 lines (29 loc) · 953 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
30
31
32
33
34
35
require 'rubygems'
require 'bundler'
require 'cucumber'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
require 'yard'
task :default => [:install, :spec, :features]
Bundler.setup
Bundler::GemHelper.install_tasks
RSpec::Core::RakeTask.new
YARD::Rake::YardocTask.new
require 'chef'
def register_spec_features(spec_type)
Cucumber::Rake::Task.new(feature_task_name(spec_type),
"Run Cucumber features (#{spec_type} support only)") do |t|
t.cucumber_opts = "CS_SPEC_TYPE=#{spec_type} features --format pretty"
t.cucumber_opts << ' -t ~@requires_chef_10' if Chef::VERSION.start_with? '0.9.'
t.cucumber_opts << " -t ~@not_implemented_#{spec_type.downcase}"
end
end
def feature_task_name(spec_type)
"features_#{spec_type.downcase}".to_sym
end
desc "Run all Cucumber features"
task :features
['RSpec', 'MiniTest'].each do |spec_type|
register_spec_features(spec_type)
task :features => feature_task_name(spec_type)
end