Package org.jbehave.core.reporters

Examples of org.jbehave.core.reporters.StoryReporter


    }
   
    @Test
    public void shouldDescribeResultToReporterWithParameterValuesWhenAvailable() {
        // Given
        StoryReporter reporter = mock(StoryReporter.class);

        // When
        String successful = "Given that a step is pending or failing";
        successful("Given that a step is $pending or $failing").withParameterValues(successful).describeTo(reporter);
        String pending = "When a step is performed";
View Full Code Here


        assertThat((String) someSteps.args, equalTo("1st"));
    }

    @Test
    public void shouldCreatePerformableStepWithResultThatDescribesTheStepPerformed() throws Exception {
        StoryReporter reporter = mock(StoryReporter.class);
        SomeSteps someSteps = new SomeSteps();
        Method method = SomeSteps.class.getMethod("aMethodWith", String.class);
        StepCandidate candidate = candidateWith("I live on the $nth floor", THEN, method, someSteps);
        StepResult result = candidate.createMatchedStep("Then I live on the 1st floor", namedParameters).perform(null);
        result.describeTo(reporter);
View Full Code Here

        assertThat(steps.nth, equalTo("ground"));
    }

    @Test
    public void shouldCreateStepFromTableValuesViaAnnotations() throws Exception {
        StoryReporter reporter = mock(StoryReporter.class);
        AnnotationNamedParameterSteps steps = new AnnotationNamedParameterSteps();
        namedParameters.put("ith", "first");
        namedParameters.put("nth", "ground");
        String patternAsString = "I live on the ith floor but some call it the nth";
        Method method = stepMethodFor("methodWithNamedParametersInNaturalOrder", AnnotationNamedParameterSteps.class);
View Full Code Here

                "When I live on the " + PARAMETER_VALUE_START + "first" + PARAMETER_VALUE_END + " floor but some call it the " + PARAMETER_VALUE_START + "ground" + PARAMETER_VALUE_END );
    }

    @Test
    public void shouldCreateStepFromTableValuesViaAnnotationsWithCustomParameterDelimiters() throws Exception {
        StoryReporter reporter = mock(StoryReporter.class);
        AnnotationNamedParameterSteps steps = new AnnotationNamedParameterSteps();
        namedParameters.put("ith", "first");
        namedParameters.put("nth", "ground");
        String patternAsString = "I live on the ith floor but some call it the nth";
        Method method = stepMethodFor("methodWithNamedParametersInNaturalOrder", AnnotationNamedParameterSteps.class);
View Full Code Here

        // Given
        SomeSteps stepsInstance = new SomeSteps();
        InjectableStepsFactory stepsFactory = new InstanceStepsFactory(new MostUsefulConfiguration(), stepsInstance);
        StepCreator stepCreator = new StepCreator(stepsInstance.getClass(), stepsFactory, null,
                new ParameterControls(), null, new SilentStepMonitor());
        StoryReporter storyReporter = mock(StoryReporter.class);

        // When
        Method method = SomeSteps.methodFor("aMethod");
        ((ParametrisedStep) stepCreator.createParametrisedStep(method, "When I run", "I run", null)).describeTo(storyReporter);
View Full Code Here

TOP

Related Classes of org.jbehave.core.reporters.StoryReporter

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.