<?php

use Peridot\Concurrency\Runner\StreamSelect\Model\Suite;
describe('Suite', function () {
    describe('title accessors', function () {
        it('should allow access to the suite title', function () {
            $suite = new Suite('description');
            $suite->setTitle('hello');
            expect($suite->getTitle())->to->equal('hello');
        });
    });
});
     it('should write a suite.start event to the test message', function () {
         $suite = new Suite('description');
         $suite->setTitle('my title');
         $this->emitter->emit('suite.start', [$suite]);
         $this->expectMessageValues($this->writeStream, ['s', 'suite.start', 'description', 'my title']);
     });
     it('should write nothing if the suite has no description', function () {
         $suite = new Suite('');
         $this->emitter->emit('suite.start', [$suite]);
         $content = $this->readMessage($this->writeStream);
         expect($content)->to->be->empty;
     });
 });
 context('when a suite.end event is emitted', function () {
     it('should write a suite.end event to the test message', function () {
         $suite = new Suite('description');
         $suite->setTitle('my title');
         $this->emitter->emit('suite.end', [$suite]);
         $this->expectMessageValues($this->writeStream, ['s', 'suite.end', 'description', 'my title']);
     });
     it('should write nothing if the suite has no description', function () {
         $suite = new Suite('');
         $this->emitter->emit('suite.end', [$suite]);
         $content = $this->readMessage($this->writeStream);
         expect($content)->to->be->empty;
     });
 });
 context('when a test.passed event is emitted', function () {
     it('should write a test.passed event to the test message', function () {
         $test = new Test('description');
         $test->setTitle('my title');