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

YamlLoaderSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 23
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 5 1
A it_is_loader() 0 4 1
A it_throws_exception_when_invalid_responses_yaml_path() 0 7 1
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