forked from chef/chef_backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
executable file
·45 lines (39 loc) · 1015 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
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env rake
require "rake"
require "rspec"
require "rspec/core"
require "rspec/core/rake_task"
require "bundler"
require "bundler/gem_tasks"
require "chefstyle"
require "rubocop/rake_task"
desc "Default task to run spec suite"
task default: %w{spec rubocop}
desc "Run spec suite"
RSpec::Core::RakeTask.new(:spec) do |task|
task.pattern = FileList["spec/**/*_spec.rb"]
end
desc "Run RSpec with code coverage"
task :coverage do
ENV["COVERAGE"] = "true"
Rake::Task["spec"].execute
end
desc "Run Rubocop style checks"
RuboCop::RakeTask.new do |cop|
cop.fail_on_error = true
end
desc "console"
task :console do
require "pry"
require "chef_backup"
require "json"
f = File.expand_path("spec/fixtures/chef-server-running.json", __dir__)
running_config = JSON.parse(File.read(f))
@runner = ChefBackup::Runner.new(
running_config.merge("restore_param" => "/tmp/backup.tgz")
)
ARGV.clear
Pry.config.history.should_save = true
Pry.config.history.should_load = true
Pry.start
end