Skip to content

Commit 5d5d9cb

Browse files
authored
Merge pull request #793 from lcreid/yet-another-fix-to-rakefile
Fix Rakefile for Edge Rails
2 parents 8159a16 + fbc1642 commit 5d5d9cb

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Rakefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
begin
2-
require "bundler/setup"
32
require "bundler/gem_tasks"
43
require "minitest/test_task"
54
require "rdoc/task"
@@ -29,12 +28,18 @@ task default: %i[test rubocop:autocorrect]
2928
namespace :test do
3029
desc "Run tests for all supported Rails versions, with current Ruby version"
3130
task :all do
31+
# I _think_ we have to run `bundle exec rake...` here. But that doesn't mean we have
32+
# to run `bundle exec rake...` when we're just running commands in the shell.
33+
# I believe this is because `rake` will load some gems, and the tests, depending on
34+
# the Rails version, may need to load conflicting versions of the gems.
35+
# When you run a single test in the shell, it hasn't had the intermediate `rake` task
36+
# to load gems, so the problem doesn't arise there.
3237
gemfiles.each do |gemfile|
33-
system("BUNDLE_GEMFILE=#{gemfile} rake test")
38+
system("BUNDLE_GEMFILE=#{gemfile} bundle exec rake test")
3439
end
3540

3641
Dir.chdir("demo")
37-
system("BUNDLE_GEMFILE= rake test:all")
42+
system("bin/rails test:all")
3843
end
3944
end
4045

0 commit comments

Comments
 (0)