Permalink
Browse files

add autotest support, which blows up right now but at least loads the…

… right files; update multi rails rake task which was missed earlier
  • Loading branch information...
1 parent 0c8e8a3 commit 4f3418d5c93a7d87eb3ce45f84a72d136bc93042 rob committed Dec 18, 2007
Showing with 26 additions and 1 deletion.
  1. +22 −0 autotest/streamlined.rb
  2. +4 −1 test/lib/multi_rails/tasks/multi_rails.rake
@@ -0,0 +1,22 @@
+# TODO - autotest blows up right now, needs work
+class Autotest::Streamlined < Autotest
+ def initialize
+ super
+ @exceptions = /\/\./
+ @test_mappings = {
+ /^lib\/(.*)\.rb$/ => proc { |filename, m|
+ file = File.basename(filename).gsub("_", "_?").gsub(".rb", "")
+ files = files_matching %r%^test/.*#{file}_test.rb$%
+ },
+ /^test\/.*_test\.rb$/ => proc { |filename, _|
+ filename
+ }
+ }
+ end
+
+ def files_matching regexp
+ @files.keys.select { |k|
+ k =~ regexp
+ }
+ end
+end
@@ -14,6 +14,7 @@ namespace :test do
desc "Run against all installed versions of Rails. Local versions found: [#{MultiRails::Loader.all_rails_versions.to_sentence}]."
task :all do
begin
+ failed_versions = []
MultiRails::Loader.all_rails_versions.each_with_index do |version, index|
silence_warnings { ENV["MULTIRAILS_RAILS_VERSION"] = version }
init_for_rails_app(version) if within_rails_app?
@@ -23,8 +24,10 @@ namespace :test do
Rake::Task[:test].invoke
rescue RuntimeError => e
puts e.message
- end
+ failed_versions << version
+ end
end
+ abort("Build failed with Rails versions: [#{failed_versions.to_sentence}].") if failed_versions.any?
ensure
clean_up
end

0 comments on commit 4f3418d

Please sign in to comment.