@Test public void testComplainsWhenFixtureIntantiationFails() { tables = parse("[" + InterpreterExpectingAFixture.class.getName() + "][NonExistingFixture]"); execute(document()); Assertions.assertAnnotatedException(tables.at(0, 0, 0)); }
@Test public void testThatFirstCellOfTableCanSpecifyAnInterpreterClass() { tables = parse("[" + InterpreterExpectingASystemUnderDevelopment.class.getName() + "]"); Example cell = tables.at(0, 0, 0); execute(document()); assertNotAnnotated(cell); }
@Test public void testThatInterpreterCanHaveAFixtureSpecifiedInSecondCell() { tables = parse( "[" + InterpreterExpectingAFixture.class.getName() + "][" + Target.class.getName() + "]"); execute(document()); assertNotAnnotated(tables.at(0, 0, 0)); assertNotAnnotated(tables.at(0, 0, 1)); }
public Integer[] cellsMarkedException() { return AnnotationUtil.cellsMarkedException(tables.at(0, 0)); }
public Integer[] cellsMarkedWrong() { return AnnotationUtil.cellsMarkedWrong(tables.at(0, 0)); }
private String actionName() { Action action = Action.parse(command.actionCells(tables.at(0, 0))); return action.name(); }
private ActionRow parseCommand() { fixture = new MockFixture(); RowSelector selector = new ActionRowSelector(fixture); return (ActionRow) selector.select(tables.at(0, 0)); }
@SuppressWarnings("unused") public void actionThrowsAnException(String ignored) { command.interpret(new Table(tables.at(0, 0))); }
public void actionReturns(String actionReturns) { fixture.willRespondTo(actionName(), actionReturns); command.interpret(new Table(tables.at(0, 0))); }
@Test public void testComplainsIfInterpreterCannotBeLoaded() { tables = parse("[NotAnInterpreter]\n" + "[1][2][3]"); execute(document()); Assertions.assertAnnotatedException(tables.at(0, 0, 0)); }