Skip to content

Commit 2e657b5

Browse files
author
Martin Smeeckaert
committed
more tests
1 parent 8682764 commit 2e657b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/Coduo/PHPHumanizer/StringSpec.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ function it_truncate_string_to_word_closest_to_a_certain_number_of_characters()
3434
$this->truncate($text, -2)->shouldReturn($text);
3535

3636
$textShort = 'Short text';
37+
$this->truncate($textShort, 1, '...')->shouldReturn("Short...");
38+
$this->truncate($textShort, 2, '...')->shouldReturn("Short...");
39+
$this->truncate($textShort, 3, '...')->shouldReturn("Short...");
3740
$this->truncate($textShort, 4, '...')->shouldReturn("Short...");
3841
$this->truncate($textShort, 5, '...')->shouldReturn("Short...");
3942
$this->truncate($textShort, 6, '...')->shouldReturn("Short...");
4043
$this->truncate($textShort, 7, '...')->shouldReturn("Short text");
44+
$this->truncate($textShort, 8, '...')->shouldReturn("Short text");
45+
$this->truncate($textShort, 9, '...')->shouldReturn("Short text");
46+
$this->truncate($textShort, 10, '...')->shouldReturn("Short text");
4147
}
4248
}

0 commit comments

Comments
 (0)