forked from chef-boneyard/chef-provisioning
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
56 lines (46 loc) · 1.2 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
require "bundler/gem_tasks"
require "rspec/core/rake_task"
desc "run specs"
RSpec::Core::RakeTask.new(:spec) do |task|
task.pattern = 'spec/**/*_spec.rb'
end
desc "run core gem specs and generated driver specs"
task :all => ["driver:spec", :spec]
FAKE_DIR = "chef-provisioning-fake"
namespace :driver do
desc "generate a '#{FAKE_DIR}' driver"
task :generate do
sh "./bin/generate_driver fake"
end
desc "run specs for #{FAKE_DIR}"
task :spec do
sh "cd #{FAKE_DIR} && bundle exec rspec"
end
desc "generate a #{FAKE_DIR} driver and run its specs"
task :verify => [:generate, :spec]
task :clean do
sh "rm -rf #{FAKE_DIR}"
end
desc "generate a fresh #{FAKE_DIR} driver, run its specs, and delete it"
task :cycle do
Rake::Task['driver:clean'].invoke
Rake::Task['driver:clean'].reenable
Rake::Task['driver:verify'].invoke
Rake::Task['driver:clean'].invoke
end
end
task :console do
require "irb"
require "irb/completion"
ARGV.clear
IRB.start
end
begin
require "chefstyle"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:chefstyle) do |task|
task.options << "--display-cop-names"
end
rescue LoadError
puts "chefstyle gem is not installed"
end