TotallyLegitSpec   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 28
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_initializable() 0 5 1
A it_always_rolls_the_requested_number() 0 4 1
A it_returns_the_size_of_the_base_dice() 0 7 1
1
<?php
2
3
namespace spec\MeadSteve\DiceApi\DiceDecorators;
4
5
use MeadSteve\DiceApi\Dice;
6
use PhpSpec\ObjectBehavior;
7
use Prophecy\Argument;
8
9
class TotallyLegitSpec extends ObjectBehavior
10
{
11
    private $definiteRoll = 5;
12
13
    function let(Dice $dice)
14
    {
15
        $this->beConstructedWith($dice, $this->definiteRoll);
16
    }
17
18
    function it_is_initializable()
19
    {
20
        $this->shouldHaveType('MeadSteve\DiceApi\DiceDecorators\TotallyLegit');
21
        $this->shouldHaveType('MeadSteve\DiceApi\Dice');
22
    }
23
24
    function it_always_rolls_the_requested_number()
25
    {
26
        $this->roll()->shouldEqual($this->definiteRoll);
27
    }
28
29
    function it_returns_the_size_of_the_base_dice(Dice $dice)
30
    {
31
        $name = "d6";
32
        $dice->name()->willReturn($name);
33
34
        $this->name()->shouldEqual($name);
35
    }
36
}
37