Package org.moresbycoffee.mbyhave8.structure

Examples of org.moresbycoffee.mbyhave8.structure.Step.execute()


            Feature("Test Feature1");
        }};

        spec.registerHooks(hooks);

        spec.execute();

        verify(hooks, never()).startFeature(Matchers.notNull(Feature.class));
        verify(hooks, never()).endFeature(Matchers.notNull(Feature.class), Matchers.eq(FeatureResult.Pending));

    }
View Full Code Here


            Feature("Test Feature2", Scenario("Scenario 2"));
        }};

        spec.registerHooks(hooks);

        spec.execute();

        final ArgumentCaptor<Feature> featureCaptor = ArgumentCaptor.forClass(Feature.class);
        inOrder.verify(hooks).startFeature(featureCaptor.capture());
        inOrder.verify(hooks).endFeature(Matchers.eq(featureCaptor.getValue()), Matchers.eq(FeatureResult.Pending));
        inOrder.verify(hooks).startFeature(Matchers.notNull(Feature.class));
View Full Code Here

                    Scenario("Scenario2"));
        }};

        spec.registerHooks(hooks);

        spec.execute();


        final ArgumentCaptor<Feature> featureCaptor = ArgumentCaptor.forClass(Feature.class);
        inOrder.verify(hooks).startFeature(featureCaptor.capture());
        assertNotNull(featureCaptor.getValue());
View Full Code Here

                    )
            );
        }};

        spec.registerHooks(hooks);
        spec.execute();


        final ArgumentCaptor<Feature> featureCaptor = ArgumentCaptor.forClass(Feature.class);
        inOrder.verify(hooks).startFeature(featureCaptor.capture());
        assertNotNull(featureCaptor.getValue());
View Full Code Here

        final MByHaveSpec spec = new MByHaveSpec() {{
            Feature("this is a feature without runner",
                    Scenario("this is a scenario",
                            given("something", () -> {})));
        }};
        final SpecOutput output = spec.execute();


        final String reportOutput = report(output);

        assertEquals(ansi().fg(GREEN).a("Feature: this is a feature without runner").reset().newline().
View Full Code Here

            Feature("this is a feature without runner",
                    Scenario("this is a scenario",
                            given("something", () -> {})));
        }};

        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() {{
View Full Code Here

                    Scenario("this is a scenario",
                            given("something", () -> {
                            })));
        }};

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

    @Test
    public void should_return_the_outputs_of_the_underlying_features() {
        final MByHaveSpec spec = new MByHaveSpec() {{
View Full Code Here

                    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

        final ScenarioHooks hooks = Mockito.mock(ScenarioHooks.class);
        final InOrder inOrder = Mockito.inOrder(hooks);

        final Scenario scenario = TestUtils.successScenario();

        scenario.execute(hooks);

        final ArgumentCaptor<Scenario> scenarioCaptor = ArgumentCaptor.forClass(Scenario.class);
        inOrder.verify(hooks).startScenario(scenarioCaptor.capture());
        inOrder.verify(hooks).endScenario(Mockito.eq(scenarioCaptor.getValue()), Mockito.eq(ScenarioResult.Success));
View Full Code Here

                    given("given step", (VoidStepImplementation) () -> { throw new AssertionError(); }),
                    when("when step", () -> { isWhenVisited.set(true); }),
                    then("then step", () -> { isThenVisited.set(true); }));
        }.scenario;

        final ScenarioOutput output = scenario.execute(DummyScenarioHooks.DUMMY);

        assertFalse("The when step should not run", isWhenVisited.get());
        assertFalse("The then step should not run", isThenVisited.get());

        assertEquals(ScenarioResult.Failure, output.getResult());
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.