forked from palkan/anyway_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
58 lines (49 loc) · 1.41 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
task(:spec).clear
desc "Run specs with Rails app"
RSpec::Core::RakeTask.new("spec") do |task|
ENV["NORAILS"] = "0"
ENV["USE_APP_CONFIGS"] = "0"
ENV["DO_NOT_INITIALIZE_RAILS"] = "0"
task.verbose = false
end
desc "Run acceptance specs without Rails"
RSpec::Core::RakeTask.new("spec:norails") do |task|
ENV["NORAILS"] = "1"
ENV["USE_APP_CONFIGS"] = "0"
ENV["DO_NOT_INITIALIZE_RAILS"] = "0"
task.verbose = false
end
desc "Run Rails secrets tests for uninitialized app"
RSpec::Core::RakeTask.new("spec:secrets") do |task|
ENV["DO_NOT_INITIALIZE_RAILS"] = "1"
ENV["USE_APP_CONFIGS"] = "0"
ENV["NORAILS"] = "0"
task.rspec_opts = "--order defined --tag secrets"
task.verbose = false
end
desc "Run Rails autoload tests for app/configs"
RSpec::Core::RakeTask.new("spec:autoload") do |task|
ENV["USE_APP_CONFIGS"] = "1"
ENV["NORAILS"] = "0"
ENV["DO_NOT_INITIALIZE_RAILS"] = "0"
task.verbose = false
end
desc "Run Ruby Next nextify"
task :nextify do
sh "bundle exec ruby-next nextify -V"
end
begin
require "rubocop/rake_task"
RuboCop::RakeTask.new
RuboCop::RakeTask.new("rubocop:md") do |task|
task.options << %w[-c .rubocop-md.yml]
end
rescue LoadError
task(:rubocop) {}
task("rubocop:md") {}
end
desc "Run the all specs"
task default: %w[rubocop rubocop:md spec:norails spec spec:secrets spec:autoload]