-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
46 lines (34 loc) · 990 Bytes
/
Rakefile
File metadata and controls
46 lines (34 loc) · 990 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
41
42
43
44
45
46
# frozen_string_literal: true
require "bundler/gem_tasks"
require "minitest/test_task"
require "standard/rake"
# Load brakeman vendor scan task
load "lib/tasks/brakeman_vendor.rake"
# Prepare test/dummy app before running tests
desc "Prepare test/dummy app (install, migrate, setup)"
task :prepare_dummy do
dummy_path = "test/dummy"
puts "Preparing test/dummy app..."
# Run bunko:install
Dir.chdir(dummy_path) do
sh "rake bunko:install RAILS_ENV=test"
end
# Run migrations
Dir.chdir(dummy_path) do
sh "rake db:migrate RAILS_ENV=test"
end
# Run bunko:setup
Dir.chdir(dummy_path) do
sh "rake bunko:setup RAILS_ENV=test"
end
# Clean test database to avoid conflicts with test fixtures
Dir.chdir(dummy_path) do
sh "rake db:test:prepare RAILS_ENV=test"
end
puts "✓ test/dummy app ready"
end
# Create test task
Minitest::TestTask.create
# Make test task depend on prepare_dummy
task test: :prepare_dummy
task default: %i[test standard]