Package org.moresbycoffee.mbyhave8

Examples of org.moresbycoffee.mbyhave8.MByHaveSpec


    @Test
    public void after_spec_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.afterSpec.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] afterSpecMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("afterSpecification", Specification.class, SpecOutput.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, afterSpecMethods, null, null, null, null).toMByHaveHook(hookTestSpec);

        hook.endSpecification(mock(Specification.class), mock(SpecOutput.class));
View Full Code Here


    @Test
    public void before_feature_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.beforeFeature.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] beforeFeatureMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("beforeFeature", Feature.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, null, beforeFeatureMethods, null, null, null).toMByHaveHook(hookTestSpec);

        hook.startFeature(mock(Feature.class));
View Full Code Here

    @Test
    public void after_feature_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.afterFeature.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] afterFeatureMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("afterFeature", Feature.class, FeatureResult.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, null, null, afterFeatureMethods, null, null).toMByHaveHook(hookTestSpec);

        hook.endFeature(mock(Feature.class), FeatureResult.Success);
View Full Code Here

    @Test
    public void before_scenario_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.beforeScenario.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] beforeScenarioMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("beforeScenario", Scenario.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, null, null, null, beforeScenarioMethods, null).toMByHaveHook(hookTestSpec);

        hook.startScenario("TEST_FEATURE_ID", mock(Scenario.class));
View Full Code Here

    @Test
    public void after_scenario_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.afterScenario.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] afterScenarioMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("afterScenario", Scenario.class, ScenarioResult.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, null, null, null, null, afterScenarioMethods).toMByHaveHook(hookTestSpec);

        hook.endScenario("TEST_FEATURE_ID", mock(Scenario.class), ScenarioResult.Success);
View Full Code Here

    public void before_spec_method_should_be_converted_to_hook() throws Throwable {
        HookTestSpec.beforeSpec.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] beforeSpecMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("beforeSpecification", Specification.class) };
        final MByHave8Hooks hook = new HookAnnotations(beforeSpecMethods, null, null, null, null, null).toMByHaveHook(hookTestSpec);

        hook.startSpecification(mock(Specification.class));

        assertTrue(HookTestSpec.beforeSpec.get().get());
View Full Code Here

    public void after_spec_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.afterSpec.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] afterSpecMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("afterSpecification", Specification.class, SpecOutput.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, afterSpecMethods, null, null, null, null).toMByHaveHook(hookTestSpec);

        hook.endSpecification(mock(Specification.class), mock(SpecOutput.class));

        assertTrue(HookTestSpec.afterSpec.get().get());
View Full Code Here

    public void before_feature_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.beforeFeature.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] beforeFeatureMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("beforeFeature", Feature.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, null, beforeFeatureMethods, null, null, null).toMByHaveHook(hookTestSpec);

        hook.startFeature(mock(Feature.class));

        assertTrue(HookTestSpec.beforeFeature.get().get());
View Full Code Here

    public void after_feature_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.afterFeature.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] afterFeatureMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("afterFeature", Feature.class, FeatureResult.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, null, null, afterFeatureMethods, null, null).toMByHaveHook(hookTestSpec);

        hook.endFeature(mock(Feature.class), FeatureResult.Success);

        assertTrue(HookTestSpec.afterFeature.get().get());
View Full Code Here

    public void before_scenario_method_should_be_converted_to_hook() throws Exception {
        HookTestSpec.beforeScenario.set(new AtomicBoolean(false));

        final HookTestSpec hookTestSpec = new HookTestSpec();
        final Method[] beforeScenarioMethods = new Method[] { HookTestSpec.class.getDeclaredMethod("beforeScenario", Scenario.class) };
        final MByHave8Hooks hook = new HookAnnotations(null, null, null, null, beforeScenarioMethods, null).toMByHaveHook(hookTestSpec);

        hook.startScenario("TEST_FEATURE_ID", mock(Scenario.class));

        assertTrue(HookTestSpec.beforeScenario.get().get());
View Full Code Here

TOP

Related Classes of org.moresbycoffee.mbyhave8.MByHaveSpec

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.