Package org.moresbycoffee.mbyhave8.result

Examples of org.moresbycoffee.mbyhave8.result.StepOutput


        } catch (final Throwable t) {
            t.printStackTrace(); //TODO replace with some logger
            result = StepResult.error(t);
        }
        hooks.endStep(this, result);
        return new StepOutput(getDescription(), result);
    }
View Full Code Here


    }

    public StepOutput skip(final StepHooks hooks) {
        hooks.startStep(this);
        hooks.endStep(this, StepResult.Skipped);
        return new StepOutput(getDescription(), StepResult.Skipped);
    }
View Full Code Here

*/
public class Given_step_Test {

    @Test
    public void given_step_implementation_without_return_value_should_AssertException_as_failure() {
        final StepOutput stepOutput = failingGivenStep().execute(DummyStepHooks.DUMMY);
        assertThat(stepOutput.getResult(), instanceOf(StepResult.Failure.class));
        assertEquals("Given Failing Given Step", stepOutput.getDescription());
    }
View Full Code Here

        assertEquals("Given Failing Given Step", stepOutput.getDescription());
    }

    @Test
    public void given_step_implementation_without_return_value_should_PendingException_as_pending() {
        final StepOutput stepOutput = pendingGivenStep().execute(DummyStepHooks.DUMMY);
        assertEquals(StepResult.Pending, stepOutput.getResult());
    }
View Full Code Here

        assertEquals(StepResult.Pending, stepOutput.getResult());
    }

    @Test
    public void given_step_implementation_without_return_value_should_any_other_Exception_as_error() {
        final StepOutput stepOutput = errorGivenStep().execute(DummyStepHooks.DUMMY);
        assertThat(stepOutput.getResult(), instanceOf(StepResult.Error.class));
    }
View Full Code Here

        assertThat(stepOutput.getResult(), instanceOf(StepResult.Error.class));
    }

    @Test
    public void failing_given_step_should_return_the_exception_in_the_step_output() {
        final StepOutput stepOutput = failingGivenStep().execute(DummyStepHooks.DUMMY);
        assertThat(stepOutput.getException(), instanceOf(AssertionError.class));
    }
View Full Code Here

        assertThat(stepOutput.getException(), instanceOf(AssertionError.class));
    }

    @Test
    public void step_in_error_should_return_the_exception_in_the_step_output() {
        final StepOutput stepOutput = errorGivenStep().execute(DummyStepHooks.DUMMY);
        assertThat(stepOutput.getException(), notNullValue());
    }
View Full Code Here

    public void implementationLess_given_step_should_return_pending_state() {
        final Step step = new MByHaveSpec() {
            Step innerStep = given("Implementationless Step");
        }.innerStep;

        final StepOutput stepOutput = step.execute(DummyStepHooks.DUMMY);

        assertEquals(StepResult.Pending, stepOutput.getResult());
    }
View Full Code Here

    public void implementationLess_when_step_should_return_pending_state() {
        final Step step = new MByHaveSpec() {
            Step innerStep = when("Implementationless Step");
        }.innerStep;

        final StepOutput stepOutput = step.execute(DummyStepHooks.DUMMY);

        assertEquals(StepResult.Pending, stepOutput.getResult());
    }
View Full Code Here

*/
public class Then_step_Test {

    @Test
    public void then_step_implementation_without_return_value_should_AssertException_as_failure() {
        StepOutput stepOutput = failingThenStep().execute(DummyStepHooks.DUMMY);
        assertThat(stepOutput.getResult(), instanceOf(StepResult.Failure.class));
    }
View Full Code Here

TOP

Related Classes of org.moresbycoffee.mbyhave8.result.StepOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.