-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRakefile
More file actions
39 lines (30 loc) · 763 Bytes
/
Rakefile
File metadata and controls
39 lines (30 loc) · 763 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
require 'bundler/gem_helper'
Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
ADAPTERS = %w(postgresql sqlite3 mysql2).freeze
ADAPTERS.each do |adapter|
desc "Run RSpec code examples for #{adapter} adapter"
RSpec::Core::RakeTask.new(adapter => "#{adapter}:adapter")
namespace adapter do
task :adapter do
ENV['ADAPTER'] = adapter
end
end
end
task :adapter do
ENV['ADAPTER'] = nil
end
if ENV['RECORD_SNAPSHOTS']
`rm -rf spec/**/__snapshots__`
end
require 'rubocop/rake_task'
RuboCop::RakeTask.new
if ENV['APPRAISAL_INITIALIZED'] || ENV['CI']
tasks = ADAPTERS + [:adapter]
tasks += [:rubocop] unless ENV['CI']
task default: tasks
else
require 'appraisal'
Appraisal::Task.new
task default: :appraisal
end