forked from ClosureTree/closure_tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
31 lines (26 loc) · 801 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
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
Bundler::GemHelper.install_tasks
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec) do |task|
task.pattern = 'spec/*_spec.rb'
end
task :default => :spec
namespace :spec do
desc 'Run all spec variants'
task :all do
rake = 'bundle exec rake'
fail unless system("#{rake} spec:generators")
[['', ''], ['db_prefix_', ''], ['', '_db_suffix'], ['abc_', '_123']].each do |prefix, suffix|
env = "DB_PREFIX=#{prefix} DB_SUFFIX=#{suffix}"
fail unless system("#{rake} spec #{env}")
end
end
desc 'Run generator specs'
RSpec::Core::RakeTask.new(:generators) do |task|
task.pattern = 'spec/generators/*_spec.rb'
end
end