tog / desert forked from pivotal/desert

Desert is a component framework for Rails that allows your plugins have a Rails app like directory structure, routes, migrations, and dependencies.

This URL has Read+Write access

pivotal (author)
Tue Apr 07 16:14:15 -0700 2009
aitor (committer)
Wed Apr 22 03:30:37 -0700 2009
desert / spec / spec_suite.rb
100644 27 lines (25 sloc) 0.815 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class SpecSuite
  def run
    dir = File.dirname(__FILE__)
    require "#{dir}/../lib/desert/supported_rails_versions"
    versions = Desert::SUPPORTED_RAILS_VERSIONS.keys.sort.reverse
    versions.each do |rails_version|
      [
        "#{dir}/unit_spec_suite.rb",
        "#{dir}/rails_root/spec/rails_spec_suite.rb"
      ].each do |suite_file|
        puts "Running #{suite_file} for Rails version #{rails_version}"
        run_with_rails_version(suite_file, rails_version) ||
          "Suite failed for Rails version #{rails_version}"
      end
    end
  end
 
  protected
  def run_with_rails_version(suite_path, rails_version)
    system("export RAILS_VERSION=#{rails_version} && ruby #{suite_path}") ||
      raise("Failed for version #{rails_version}")
  end
end
 
if $0 == __FILE__
  SpecSuite.new.run
end