-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
33 lines (27 loc) · 830 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
# frozen_string_literal: true
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
task default: %w[rubocop rspec]
RuboCop::RakeTask.new(:rubocop) do
puts "\n #{'*' * 10} Rubocop #{'*' * 10}"
end
namespace :rspec do
desc 'Testing RSpec Unit'
RSpec::Core::RakeTask.new(:unit) do |task|
puts "\n #{'*' * 10} Testing RSpec Unit #{'*' * 10}"
task.rspec_opts = '--pattern "spec/{unit}/**"'
end
desc 'Testing RSpec Integration'
RSpec::Core::RakeTask.new(:integration) do |task|
puts "\n #{'*' * 10} Testing RSpec Integration #{'*' * 10}"
task.rspec_opts = '--pattern "spec/{integration}/**"'
end
rescue LoadError
# no rspec available
end
task rspec: %w[rspec:unit rspec:integration]
desc 'Run RSpec with coverage'
task :coverage do
ENV['COVERAGE'] = 'true'
Rake::Task['rspec'].invoke
end