mirror of
https://github.com/brianhempel/active_record_union
synced 2023-03-27 23:21:57 -04:00
Add rake test_rails_4_2
and rake test_rails_5_0
commands.
This commit is contained in:
parent
5a47ade141
commit
5a2e7a537f
1 changed files with 16 additions and 0 deletions
16
Rakefile
16
Rakefile
|
@ -20,6 +20,11 @@ module TestTasks
|
|||
end
|
||||
end
|
||||
|
||||
def run_one(env, cmd = "bundle install && #{TEST_CMD}")
|
||||
full_cmd = to_bash_cmd_with_env(cmd, env)
|
||||
exec(full_cmd)
|
||||
end
|
||||
|
||||
def run(env, cmd)
|
||||
Bundler.with_clean_env do
|
||||
full_cmd = to_bash_cmd_with_env(cmd, env)
|
||||
|
@ -43,3 +48,14 @@ task :test_all_gemfiles do
|
|||
envs = TestTasks.gemfiles.map { |gemfile| { 'BUNDLE_GEMFILE' => gemfile } }
|
||||
TestTasks.run_all envs, "✓ Tests pass with all #{envs.size} gemfiles"
|
||||
end
|
||||
|
||||
|
||||
TestTasks.gemfiles.each do |gemfile|
|
||||
rails_version_underscored = gemfile[/rails_(.+)\.gemfile/, 1]
|
||||
|
||||
desc "Test Rails #{rails_version_underscored.gsub("_", ".")}"
|
||||
task :"test_rails_#{rails_version_underscored}" do
|
||||
env = { 'BUNDLE_GEMFILE' => gemfile }
|
||||
TestTasks.run_one(env)
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue