Created
June 10, 2014 22:57
-
-
Save MacDada/ae873a8be280be2c83b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Dn; | |
| class StringCalculatorSpec | |
| { | |
| function specification() | |
| { | |
| return [ | |
| 'It is initializable' => function ($calculator) | |
| { | |
| $calculator->shouldHaveType('StringCalculator'); | |
| }, | |
| 'It requires string input' => function ($calculator) | |
| { | |
| $calculator->shouldThrow('\InvalidArgumentException')->during('add', [null]); | |
| }, | |
| 'It adds 2 numbers separated by comma' => function ($calculator) | |
| { | |
| $calculator->add('1,2')->shouldReturn(3); | |
| }, | |
| ]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment