-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
StringIteratorSpec.php
44 lines (32 loc) · 1.14 KB
/
StringIteratorSpec.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace spec\loophp\collection\Iterator;
use loophp\collection\Iterator\StringIterator;
use PhpSpec\ObjectBehavior;
class StringIteratorSpec extends ObjectBehavior
{
public function it_can_iterate_with_default_delimiter(): void
{
$this->beConstructedWith('A string.');
$this->getInnerIterator()->shouldIterateAs(['A', ' ', 's', 't', 'r', 'i', 'n', 'g', '.']);
}
public function it_can_iterate_with_given_delimiter(): void
{
$this->beConstructedWith('I am a string.', ' ');
$this->getInnerIterator()->shouldIterateAs(['I', 'am', 'a', 'string.']);
}
public function it_is_initializable_with_default_delimiter(): void
{
$this->beConstructedWith('I am a string.');
$this->shouldHaveType(StringIterator::class);
}
public function it_is_initializable_with_given_delimiter(): void
{
$this->beConstructedWith('I am a string.', ' ');
$this->shouldHaveType(StringIterator::class);
}
}