-
Notifications
You must be signed in to change notification settings - Fork 28
/
Rakefile
36 lines (28 loc) · 1020 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
# frozen_string_literal: true
require "rubygems"
require "puppetlabs_spec_helper/rake_tasks"
require "rake"
require "rspec/core/rake_task"
Dir.glob("tasks/*.rake").each { |r| load r}
RSpec::Core::RakeTask.new(:spec)
# Run unit tests and rubocopy checks by default
task :default => ["spec:suite:unit", "rubocop"]
# To run unit tests: bundle exec rake spec:suite:unit
namespace :spec do
namespace :suite do
desc "Run all specs in unit spec suite"
RSpec::Core::RakeTask.new("unit") do |t|
t.pattern = "./spec/unit/**/*_spec.rb"
end
end
end
namespace :doc do
desc "Serve YARD documentation on %s:%d" % [ENV.fetch("YARD_BIND", "127.0.0.1"), ENV.fetch("YARD_PORT", "9293")]
task :serve do
system("yard server --reload --bind %s --port %d" % [ENV.fetch("YARD_BIND", "127.0.0.1"), ENV.fetch("YARD_PORT", "9293")])
end
desc "Generate documentatin into the %s" % ENV.fetch("YARD_OUT", "doc")
task :yard do
system("yard doc --output-dir %s" % ENV.fetch("YARD_OUT", "doc"))
end
end