Package org.moresbycoffee.mbyhave8

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec.execute()


            Feature("Implementationless step",
                Scenario("testing implementationless step",
                    given("a step without implementation")));
        }};

        val output = spec.execute();

        assertEquals(SpecResult.Pending, output.getResult());
    }

View Full Code Here


                flag.set(true);
            }
        };

        assertFalse(flag.get());
        val output = spec.execute();
        assertTrue(flag.get());

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

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

        assertFalse(hasGivenBeenVisited.get());
        val output = spec.execute();
        assertTrue(hasGivenBeenVisited.get());
        assertEquals(SpecResult.Success, output.getResult());
    }

View Full Code Here

            Feature("this is a pending feature",
                Scenario("this is a scenario",
                    given("something", (VoidStepImplementation) () -> { throw new PendingException(); })));
        }};

        final SpecOutput output = spec.execute();

        assertEquals(SpecResult.Pending, output.getResult());
    }

View Full Code Here

            Feature("this is a pending feature",
                    Scenario("this is a scenario",
                            given("something", (VoidStepImplementation) () -> { throw new PendingException(); })));
        }};

        final SpecOutput output = spec.execute();

        assertEquals(SpecResult.Pending, output.getResult());
    }

    @Test
View Full Code Here

            void whenStepImplementation()  { whenStepVisitedFlag.set(true); }
            void thenStepImplementation()  { thenStepVisitedFlag.set(true); }
        };

        assertFalse(givenStepVisitedFlag.get() || whenStepVisitedFlag.get() || thenStepVisitedFlag.get());
        final SpecOutput output = spec.execute();
        assertTrue(givenStepVisitedFlag.get() && whenStepVisitedFlag.get() && thenStepVisitedFlag.get());

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

            void givenStepImplementation() {
                //Doing nothing
            }
        };

        spec.execute(testOutput);

        assertEquals(ansi().fg(GREEN).a("Feature: this is a feature without runner").reset().newline().
                            fg(GREEN).a("    Scenario: this is a scenario").reset().newline().
                            fg(GREEN).a("        Given something").reset().newline().toString(),
                     testOutput.toString());
View Full Code Here

                    )
                ).issue("7");

            }};

            spec.execute(testOutput);

            assertThat(testOutput.toString(),
                       startsWith(ansi().fg(YELLOW).a("Feature: this is a feature without runner").reset().newline().
                                         fg(YELLOW).a("    Scenario: this is a scenario").reset().newline().
                                         fg(YELLOW).a("        Given something").reset().newline().
View Full Code Here

            Feature("Test Feature1", Scenario("Scenario 1"));
        }};

        spec.registerHooks(hooks);

        spec.execute();

        inOrder.verify(hooks).startSpecification(Matchers.notNull(Specification.class));
        inOrder.verify(hooks).startFeature(Matchers.notNull(Feature.class));
        inOrder.verify(hooks).endFeature(Matchers.notNull(Feature.class), Matchers.eq(FeatureResult.Pending));
        inOrder.verify(hooks).endSpecification(Matchers.notNull(Specification.class), Matchers.notNull(SpecOutput.class));
View Full Code Here

            Feature("Test Feature1", Scenario("Scenario 1"));
        }};

        spec.registerHooks(hooks);

        spec.execute();

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

    }
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.