package org.jruby.test;

import junit.framework.Test;

/**
 *
 * @author headius
 */
public class Ruby1_9TestSuite extends TestUnitTestSuite {
    public static final String TEST_INDEX = "ruby_1_9_index";

    public Ruby1_9TestSuite(String testIndex) throws Exception {
        super(testIndex);
    }

    /**
     * suite method automatically generated by JUnit module
     */
    public static Test suite() throws Exception {
        return new Ruby1_9TestSuite(TEST_INDEX);
    }

    @Override
    protected String generateTestScript(String scriptName, String testClass) {
        StringBuffer script = new StringBuffer();
        script.append("require 'minitest/unit'\n");
        script.append("require '" + scriptName + "'\n");
        script.append("unit = MiniTest::Unit.new\n");
        script.append("unit.run_test_suites\n");
        script.append("unit.report\n");
        return script.toString();
    }
}
