Skip to content

Instantly share code, notes, and snippets.

@MacDada
Created June 10, 2014 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MacDada/a1c730190a32d1362e12 to your computer and use it in GitHub Desktop.
Save MacDada/a1c730190a32d1362e12 to your computer and use it in GitHub Desktop.
<?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