Esempio n. 1
0
describe("Configuration", function () {
    before_each(function () {
        $this->config = new Configuration();
    });
    context("with default value", function () {
        it("assertion exceptions should be Exception", function () {
            ok($this->config->assertion_exceptions == array("\\Exception"));
        });
        it("convert error to exception should be true", function () {
            ok($this->config->convert_error_to_exception === true);
        });
        it("reporter should be spec", function () {
            ok("Preview\\Reporter\\Spec" == get_class($this->config->reporter));
        });
        it("color should be set according current stdout", function () {
            ok($this->config->color_support == Preview::is_tty());
        });
        it("test groups should be empty", function () {
            ok(empty($this->test_groups));
        });
        it("use implicit context", function () {
            ok($this->config->use_implicit_context);
        });
        it("shared_dir_name should be shared", function () {
            ok($this->config->shared_dir_name == "shared");
        });
        it("spec_file_regexp should be _spec.php", function () {
            ok($this->config->spec_file_regexp == '/_spec\\.php/');
        });
        it("fail_fast should be false", function () {
            ok($this->config->fail_fast === false);