run_all.rb 513 B

123456789101112131415161718192021
  1. def bundle_check
  2. `bundle check` == "The Gemfile's dependencies are satisfied\n"
  3. end
  4. command = 'ruby -w -Ilib -Itest test/all.rb'
  5. gemfiles = %w(ci/Gemfile.rails-3.x ci/Gemfile.rails-2.3.x ci/Gemfile.no-rails)
  6. results = gemfiles.map do |gemfile|
  7. puts "BUNDLE_GEMFILE=#{gemfile}"
  8. ENV['BUNDLE_GEMFILE'] = gemfile
  9. unless bundle_check
  10. puts "bundle install"
  11. system('bundle install')
  12. end
  13. puts command
  14. system('ruby -w -Ilib -Itest test/all.rb')
  15. end
  16. exit(results.inject(true) { |a, b| a && b })