Completed
Push — master ( d492a5...c08f37 )
by Johnny
02:30
created

it_should_decode_if_constructed_with_value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace spec\johnnymast\Morsecode;
4
5
use johnnymast\Morsecode\Morsecode;
6
use PhpSpec\ObjectBehavior;
7
8
class MorsecodeSpec extends ObjectBehavior
9
{
10
    function it_is_initializable()
11
    {
12
        $this->shouldHaveType(Morsecode::class);
13
    }
14
15
    function it_can_encode()
16
    {
17
        $this->encode('sos')->shouldReturn('... --- ...');
18
    }
19
20
    function it_can_decode()
21
    {
22
        $this->decode('... --- ...')->shouldReturn('sos');
23
    }
24
25
    function it_should_encode_if_constructed_with_value() {
26
        $this->beConstructedWith('sos');
27
        $this->encode()->shouldReturn('... --- ...');
28
    }
29
30
    function it_should_decode_if_constructed_with_value() {
31
        $this->beConstructedWith('... --- ...');
32
        $this->decode()->shouldReturn('sos');
33
    }
34
}
35