Sha256: b1b8344c1b76f5a9100fa37ed43cd8b86a7305e5e0ccf2976d20ece5f992dc2a

Contents?: true

Size: 944 Bytes

Versions: 21

Compression:

Stored size: 944 Bytes

Contents

require "rubygems"
require "spec"

class ExampleSuite
  def run
    options = ::Spec::Runner::OptionParser.new.parse(ARGV.dup, STDERR, STDOUT, false)
    $behaviour_runner = options.create_behaviour_runner
    
    require_specs

    puts "Running Example Suite"
    $behaviour_runner.run(ARGV, false)

    run_rspec_examples
    run_test_unit_examples
  end

  def require_specs
    exclusions = []
    exclusions << "rspec/"
    exclusions << "test_unit/"

    Dir["#{dir}/**/*_example.rb"].each do |file|
      unless exclusions.any? {|match| file.include?(match)}
        require file
      end
    end
  end

  def run_rspec_examples
    system("ruby #{dir}/rspec_example_suite.rb") || raise("Rspec suite Failed")
  end

  def run_test_unit_examples
    system("ruby #{dir}/test_unit_example_suite.rb") || raise("Test::Unit suite Failed")
  end

  def dir
    File.dirname(__FILE__)
  end
end

if $0 == __FILE__
  ExampleSuite.new.run
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rr-0.2.4 examples/example_suite.rb