Skip to content

Commit

Permalink
Fix script that runs tests against all available Gemfiles
Browse files Browse the repository at this point in the history
BUNDLE_GEMFILE needs the full path to work properly.

Load all custom Gemfiles rather than a fixed list, so adding/removing
files from the gemfiles/ folder just works.
  • Loading branch information
carlosantoniodasilva committed May 7, 2014
1 parent 5e8e50f commit 5749667
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/run_all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ def bundle_check
end

command = 'ruby -w -Ilib -Itest test/all.rb'
gemfiles = %w(gemfiles/Gemfile.rails-3.x gemfiles/Gemfile.rails-2.3.x gemfiles/Gemfile.no-rails)
gemfiles = %w(Gemfile) + Dir['gemfiles/Gemfile*'].reject { |f| f.end_with?('.lock') }

results = gemfiles.map do |gemfile|
puts "BUNDLE_GEMFILE=#{gemfile}"
ENV['BUNDLE_GEMFILE'] = gemfile
ENV['BUNDLE_GEMFILE'] = File.expand_path("../../#{gemfile}", __FILE__)

unless bundle_check
puts "bundle install"
system('bundle install')
end

puts command
system('ruby -w -Ilib -Itest test/all.rb')
system command
end

exit(results.inject(true) { |a, b| a && b })

0 comments on commit 5749667

Please sign in to comment.