-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
40 lines (33 loc) · 920 Bytes
/
Rakefile
File metadata and controls
40 lines (33 loc) · 920 Bytes
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
begin
require "bundler/setup"
rescue LoadError
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
end
# Dummy App
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load "rails/tasks/engine.rake"
# Gem tasks
begin
Bundler::GemHelper.install_tasks
rescue RuntimeError
Bundler::GemHelper.install_tasks name: "protosite"
end
# Rubocop
require "rubocop/rake_task"
RuboCop::RakeTask.new
# RSpec
load "rspec/rails/tasks/rspec.rake"
namespace :spec do
desc "Run the unit code examples"
RSpec::Core::RakeTask.new(:unit) do |t|
file_list = FileList["spec/**/*_spec.rb"]
%w[features].each do |exclude|
file_list = file_list.exclude("spec/#{exclude}/**/*_spec.rb")
end
t.pattern = file_list
end
end
# Define the default
Rake::Task["default"].prerequisites.clear
Rake::Task["default"].clear
task default: [:rubocop, "app:db:test:prepare", :spec]