Sha256: c3ab1593f18d0ee5535a63a5e7464313fa204d2ef0dd70461fd865eda69cd9e7

Contents?: true

Size: 1.14 KB

Versions: 5

Compression:

Stored size: 1.14 KB

Contents

class SpecSuite
  class << self
    def all
      system("ruby #{dir}/core_spec_suite.rb") || raise("Core Spec Suite failed")
      dir = File.dirname(__FILE__)
      require "#{dir}/../lib/erector/rails/supported_rails_versions"
      versions = Erector::Rails::SUPPORTED_RAILS_VERSIONS.keys.sort.reverse
      versions.each do |rails_version|
        puts "Running rails_spec_suite for Rails version #{rails_version}"
          run_with_rails_version("#{dir}/rails_spec_suite.rb", rails_version) ||
            "Suite failed for Rails version #{rails_version}"
      end
    end

    def core
      run Dir["#{dir}/{erect,erector}/**/*_spec.rb"]
    end

    def rails
      Dir.chdir("#{dir}/rails_root") do
        run Dir["spec/**/*_spec.rb"]
      end
    end

    def run(files)
      files.each do |file|
        require file
      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

    def dir
      File.dirname(__FILE__)
    end
  end
end

if $0 == __FILE__
  SpecSuite.all
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
pivotal-erector-0.5.1 spec/spec_suite.rb
erector-0.4.200 spec/spec_suite.rb
erector-0.5.0 spec/spec_suite.rb
erector-0.5.1 spec/spec_suite.rb
erector-0.4.191 spec/spec_suite.rb