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.1.10 examples/example_suite.rb
rr-0.1.12 examples/example_suite.rb
rr-0.1.15 examples/example_suite.rb
rr-0.1.11 examples/example_suite.rb
rr-0.1.2 examples/example_suite.rb
rr-0.1.4 examples/example_suite.rb
rr-0.1.0 examples/example_suite.rb
rr-0.1.5 examples/example_suite.rb
rr-0.1.7 examples/example_suite.rb
rr-0.1.3 examples/example_suite.rb
rr-0.1.8 examples/example_suite.rb
rr-0.1.13 examples/example_suite.rb
rr-0.1.6 examples/example_suite.rb
rr-0.1.1 examples/example_suite.rb
rr-0.1.14 examples/example_suite.rb
rr-0.2.5 examples/example_suite.rb
rr-0.1.9 examples/example_suite.rb
rr-0.2.1 examples/example_suite.rb
rr-0.2.3 examples/example_suite.rb
rr-0.2.2 examples/example_suite.rb