Skip to content

Commit 86d0fe8

Browse files
author
vagrant
committed
Added rat and deadRat formatters
1 parent 7204c8c commit 86d0fe8

File tree

6 files changed

+178
-0
lines changed

6 files changed

+178
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace spec\PhpSpec\NyanFormattersExtension;
4+
5+
use PhpSpec\NyanFormattersExtension\Extension;
6+
use PhpSpec\Extension as PhpSpecExtension;
7+
use PhpSpec\ObjectBehavior;
8+
use PhpSpec\ServiceContainer;
9+
10+
/**
11+
* @author Piotr Walków <[email protected]>
12+
*/
13+
class ExtensionSpec extends ObjectBehavior
14+
{
15+
function it_is_initializable()
16+
{
17+
$this->shouldHaveType(Extension::class);
18+
$this->shouldImplement(PhpSpecExtension::class);
19+
}
20+
21+
function it_loads_formatters(
22+
ServiceContainer $container
23+
) {
24+
$this->load($container, []);
25+
}
26+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace spec\PhpSpec\NyanFormattersExtension\Formatter;
4+
5+
use PhpSpec\Console\ConsoleIO;
6+
use PhpSpec\Formatter\Presenter\Presenter;
7+
use PhpSpec\Listener\StatisticsCollector;
8+
use PhpSpec\NyanFormattersExtension\Formatter\DeadRatFormatter;
9+
use PhpSpec\ObjectBehavior;
10+
11+
/**
12+
* DeadRatFormatterSpec
13+
*
14+
* @package spec\PhpSpec\NyanFormattersExtension\Formatter
15+
*
16+
* @author Piotr Walków <[email protected]>
17+
*/
18+
class DeadRatFormatterSpec extends ObjectBehavior
19+
{
20+
function let(
21+
Presenter $presenter,
22+
ConsoleIO $io,
23+
StatisticsCollector $stats
24+
) {
25+
$this->beConstructedWith($presenter, $io, $stats);
26+
}
27+
28+
function it_is_initializable()
29+
{
30+
$this->shouldHaveType(DeadRatFormatter::class);
31+
32+
}
33+
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace spec\PhpSpec\NyanFormattersExtension\Formatter;
4+
5+
use PhpSpec\Console\ConsoleIO;
6+
use PhpSpec\Formatter\Presenter\Presenter;
7+
use PhpSpec\Listener\StatisticsCollector;
8+
use PhpSpec\NyanFormattersExtension\Formatter\RatFormatter;
9+
use PhpSpec\ObjectBehavior;
10+
11+
/**
12+
* RatFormatterSpec
13+
*
14+
* @package spec\PhpSpec\NyanFormattersExtension\Formatter
15+
*
16+
* @author Piotr Walków <[email protected]>
17+
*/
18+
class RatFormatterSpec extends ObjectBehavior
19+
{
20+
function let(
21+
Presenter $presenter,
22+
ConsoleIO $io,
23+
StatisticsCollector $stats
24+
) {
25+
$this->beConstructedWith($presenter, $io, $stats);
26+
}
27+
28+
function it_is_initializable()
29+
{
30+
$this->shouldHaveType(RatFormatter::class);
31+
32+
}
33+
34+
}

src/PhpSpec/NyanFormattersExtension/Extension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public function load(ServiceContainer $container, array $params)
2222
$this->addFormatter($container, 'cat', 'PhpSpec\NyanFormattersExtension\Formatter\NyanFormatter');
2323
$this->addFormatter($container, 'dino', 'PhpSpec\NyanFormattersExtension\Formatter\DinoFormatter');
2424
$this->addFormatter($container, 'crab', 'PhpSpec\NyanFormattersExtension\Formatter\CrabFormatter');
25+
$this->addFormatter($container, 'rat', 'PhpSpec\NyanFormattersExtension\Formatter\RatFormatter');
26+
$this->addFormatter($container, 'deadRat', 'PhpSpec\NyanFormattersExtension\Formatter\DeadRatFormatter');
2527
}
2628

2729
/**
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace PhpSpec\NyanFormattersExtension\Formatter;
4+
5+
/**
6+
* DeadRatFormatter
7+
*
8+
* @package NyanFormattersExtension
9+
*
10+
* @author Piotr Walków <[email protected]>
11+
*/
12+
class DeadRatFormatter extends NyanFormatter
13+
{
14+
protected $states =
15+
array(
16+
array(
17+
'~ ~ ~ ',
18+
' ~ ~ ',
19+
' _ ~ ~ ~ ~',
20+
'/ \ M___M__ ',
21+
'\__/_} _} >',
22+
' \____/ȣȣ ',
23+
),
24+
array(
25+
' ~ ~ ',
26+
' ~ ~ ~ ~',
27+
'~_ ~ ~ ',
28+
'/ \ M___M__ ',
29+
'\__/_} _} >',
30+
' \____/ȣȣ ',
31+
),
32+
array(
33+
' ~ ~ ~ ~',
34+
'~ ~ ~ ',
35+
' _ ~ ',
36+
'/ \ M___M__ ',
37+
'\__/_} _} >',
38+
' \____/ȣȣ ',
39+
)
40+
);
41+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace PhpSpec\NyanFormattersExtension\Formatter;
4+
5+
/**
6+
* RatFormatter
7+
*
8+
* @package NyanFormattersExtension
9+
*
10+
* @author Piotr Walków <[email protected]>
11+
*/
12+
class RatFormatter extends NyanFormatter
13+
{
14+
protected $states =
15+
array(
16+
array(
17+
' ~ ~ ',
18+
' ~ ',
19+
' ~ ___ ~ ~',
20+
' __/_ \☊☊_ ',
21+
'/ \_}__}__>',
22+
'\__ W W '
23+
),
24+
array(
25+
' ~ ',
26+
' ~ ~ ~',
27+
'~ ~ ___ ~ ',
28+
' __/_ \☊☊_ ',
29+
'/ \_}__}__>',
30+
'\_/ M M '
31+
),
32+
array(
33+
' ~ ~ ~',
34+
'~ ~ ~ ~ ',
35+
' ___ ~',
36+
' __/_ \☊☊_ ',
37+
'/ \_}__}__>',
38+
'\__ W W '
39+
)
40+
);
41+
}

0 commit comments

Comments
 (0)