コード例 #1
0
ファイル: ExpressionBotSpec.php プロジェクト: mcrumm/phlack
 public function it_returns_the_syntax_error_as_the_response_in_bad_commands($language, SlashCommand $command)
 {
     $command->offsetGet('text')->willReturn('foo + 2');
     $errorMessage = 'Variable "foo" is not valid around position 1.';
     $error = new SyntaxError('Variable "foo" is not valid', 1);
     $language->evaluate('foo + 2', [])->willThrow($error);
     $this->execute($command)['text']->shouldBe($errorMessage);
 }