-
Notifications
You must be signed in to change notification settings - Fork 268
/
Rakefile
36 lines (27 loc) · 916 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
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path("config/application", __dir__)
Hours::Application.load_tasks
if defined?(RSpec)
task(:spec).clear
desc "Run all specs"
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = "--tag ~factory"
end
desc "Run factory specs."
RSpec::Core::RakeTask.new(:factory_specs) do |t|
t.pattern = "./spec/models/factories_spec.rb"
end
task spec: :factory_specs
end
namespace :brakeman do
desc "Run Brakeman"
task :check, :output_files do |_t, args|
require "brakeman"
files = args[:output_files].split(" ") if args[:output_files]
Brakeman.run app_path: ".", output_files: files, print_report: true
end
end
task(:default).clear
task default: [:spec, "brakeman:check"]