Completed
Push — master ( c5de01...c9c19d )
by
unknown
07:34 queued 05:10
created

YamlLoaderSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace spec\Coduo\TuTu\Config\Loader;
4
5
use PhpSpec\ObjectBehavior;
6
use Prophecy\Argument;
7
8
class YamlLoaderSpec extends ObjectBehavior
9
{
10
    private $responsesYaml;
11
12
    function let()
13
    {
14
        $this->responsesYaml = __DIR__ . '/../../../../config/responses.yml.dist';
15
        $this->beConstructedWith($this->responsesYaml);
16
    }
17
18
    function it_is_loader()
19
    {
20
        $this->shouldBeAnInstanceOf('Coduo\TuTu\Config\Loader\Loader');
21
    }
22
23
    function it_throws_exception_when_invalid_responses_yaml_path()
24
    {
25
        $notExistingFilePath = dirname($this->responsesYaml . '/this_file_does_not_exists');
26
        $expectedMessage = sprintf("File \"%s\" does not exist.", $notExistingFilePath);
27
        $this->shouldThrow(new \InvalidArgumentException($expectedMessage))
28
            ->during('__construct', [$notExistingFilePath]);
29
    }
30
}
31