public function shouldThrowExceptionForBadJsonData()
{
$machine = new StateMachine(new Context(new Identifier('json-test', 'json-machine')));
$loader = JSON::createFromFile(__DIR__ . '/fixture-bad-json.json');
try {
$loader->load($machine);
$this->fail('should not come here');
} catch (Exception $e) {
$this->assertEquals(Exception::BAD_LOADERDATA, $e->getCode());
$this->assertContains('decode', $e->getMessage());
}
}