forked from pboling/activerecord-tablefree
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
48 lines (42 loc) · 1.26 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
require 'bundler/gem_tasks'
require 'appraisal'
require 'rake/testtask'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
desc 'Default: clean, all.'
task default: %i[clean all]
desc 'Test the activerecord-tablefree on all supported Rails versions.'
task :all do |_t|
# TODO: cucumber feature specs appear to be written for Rails 2, and will need an overhaul for Rails 5.
if ENV['BUNDLE_GEMFILE']
exec('rake test spec')
# exec('rake test spec cucumber')
else
Rake::Task['appraisal:install'].execute
exec('rake appraisal test spec')
# exec('rake appraisal test spec cucumber')
end
end
desc 'Test the activerecord-tablefree plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib' << 'profile'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Run specs'
RSpec::Core::RakeTask.new do |t|
t.pattern = './spec/**/*_spec.rb' # don't need this, it's default.
# Put spec opts in a file named .rspec in root
end
desc 'Run integration test'
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w[--format progress]
end
desc 'Clean up files.'
task :clean do |_t|
FileUtils.rm_rf 'doc'
FileUtils.rm_rf 'tmp'
FileUtils.rm_rf 'pkg'
FileUtils.rm_rf 'public'
Dir.glob('activerecord-tablefree-*.gem').each { |f| FileUtils.rm f }
end