Skip to content

Instantly share code, notes, and snippets.

@MacDada

MacDada/dnspec.php

Created Jun 10, 2014
Embed
What would you like to do?
<?php
namespace Dn;
class StringCalculatorSpec
{
public function specification()
{
return [
'it_is_initializable' => function ($it) {
$it->shouldHaveType('StringCalculator');
},
'it_requires_string_input' => function ($it) {
$it->shouldThrow('\InvalidArgumentException')->during('add', [null]);
},
'it_adds_2_numbers_separated_by_comma' => function ($it) {
$it->add('1,2')->shouldReturn(3);
}
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment