/
Rakefile
39 lines (36 loc) · 991 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
37
38
39
# frozen_string_literal: true
require 'bundler/gem_tasks'
# RSpec
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new do |spec|
spec.rspec_opts = '-f progress' if ENV['CI']
end
task default: ['testapp:create', :spec]
# Create a test Rails app in tmp/railsapp for testing the rake
# tasks and overall Rails integration with Aruba.
#
namespace :testapp do
desc 'Create a dummy rails application for testing in /tmp'
task :create do
options = %w[
-q
--skip-action-cable
--skip-action-mailer
--skip-action-text
--skip-active-storage
--skip-asset-pipeline
--skip-bundle
--skip-git
--skip-javascript
--skip-sprockets
--skip-webpack-install
]
FileUtils.mkdir_p('tmp/aruba')
Dir.chdir('tmp') do
FileUtils.rm_rf('railsapp')
sh "rails new railsapp #{options.join(' ')}"
end
FileUtils.cp_r('spec/fixtures/railsapp/.', 'tmp/railsapp/')
FileUtils.rm('tmp/railsapp/Gemfile')
end
end