Examples of MByHaveSpec


Examples of org.moresbycoffee.mbyhave8.MByHaveSpec

        assertThat(errorWhenStep().execute(DummyStepHooks.DUMMY).getResult(), instanceOf(StepResult.Error.class));
    }

    @Test
    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);
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec

    public void second_step_should_not_run_after_a_failing_step() {

        final AtomicBoolean isWhenVisited = new AtomicBoolean(false);
        final AtomicBoolean isThenVisited = new AtomicBoolean(false);

        final Scenario scenario = new MByHaveSpec() {
            Scenario scenario = Scenario("scenario description",
                    given("given step", (VoidStepImplementation) () -> { throw new AssertionError(); }),
                    when("when step", () -> { isWhenVisited.set(true); }),
                    then("then step", () -> { isThenVisited.set(true); }));
        }.scenario;
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec

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

    @Test
    public void implementationLess_then_step_should_return_pending_state() {
        final Step step = new MByHaveSpec() {
            Step innerStep = then("Implementationless Step");
        }.innerStep;

        final StepOutput stepOutput = step.execute(DummyStepHooks.DUMMY);
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec

*/
public class Spec_execution_Test {

    @Test
    public void should_return_SUCCESS_when_the_only_features_result_is_succes() {
        final MByHaveSpec spec = new MByHaveSpec() {{
            Feature("this is a feature without runner",
                    Scenario("this is a scenario",
                            given("something", () -> {})));
        }};

        assertEquals(SpecResult.Success, spec.execute().getResult());
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec

        assertEquals(SpecResult.Success, spec.execute().getResult());
    }

    @Test
    public void should_return_the_name_of_the_class_in_the_spec_output() {
        final MByHaveSpec spec = new MByHaveSpec() {{
            Feature("this is a feature without runner",
                    Scenario("this is a scenario",
                            given("something", () -> {
                            })));
        }};

        assertThat(spec.execute().getTestClassName(), startsWith(this.getClass().getName()));
    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec

        assertThat(spec.execute().getTestClassName(), startsWith(this.getClass().getName()));
    }

    @Test
    public void should_return_the_outputs_of_the_underlying_features() {
        final MByHaveSpec spec = new MByHaveSpec() {{
            Feature("this is a feature without runner",
                    Scenario("this is a scenario",
                            given("something", () -> {
                            })));
        }};

        final SpecOutput output = spec.execute();

        assertEquals(1, output.getFeatures().size());
        assertEquals(FeatureResult.Success, output.getFeatures().iterator().next().getResult());

    }
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec

    }

    @Test
    public void should_not_execute_not_executable_features() {
        final MByHaveSpec spec = new MByHaveSpec() {{
            Feature("this is a feature without runner",
                Scenario("this is a scenario",
                    given("something", () -> {})
                )
            ).tag("Broken");
        }};

        final SpecOutput output = spec.getSpecification().execute(
                spec.getClass(), new NullReporter(), new CallbackAnnouncer(),
                new Filter("~Broken"));

        assertEquals(0, output.getFeatures().size());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.