Package ar.com.dgarcia.javaspec.impl.context

Examples of ar.com.dgarcia.javaspec.impl.context.MappedContext


        assertThat(context.<Integer>get("foo")).isEqualTo(3);
    }

    @Test
    public void itShouldAllowVariableDefinitionInDifferentContexts() {
        MappedContext otherContext = MappedContext.create();

        context.letFoo(()-> 1);
        sharedVariable.set(otherContext);
        context.letFoo(()-> 2);
View Full Code Here


    /**
     * Creates a new context to run given code, restoring shared context to previous value after execution
     * @param codeToRun Code to run in own context
     */
    private void runWithOwnSubContext(Runnable codeToRun) {
        MappedContext testRunContext = MappedContext.create();
        testRunContext.setParentDefinition(parentContext);

        TestContext previousContext = sharedContext.get();
        sharedContext.set(testRunContext);
        try{
            codeToRun.run();
View Full Code Here

TOP

Related Classes of ar.com.dgarcia.javaspec.impl.context.MappedContext

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.