Skip to content

Commit

Permalink
Updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Sep 30, 2018
1 parent c86bd90 commit 1c84f67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private String renderedFormOf(Examples exampleTable, ScenarioDisplayOption displ
if (displayOption == WithTitle) {
String exampleTitle = "### " + tableName;
renderedExampleTable.append(exampleTitle);
renderedExampleTable.append(System.lineSeparator());
// renderedExampleTable.append(System.lineSeparator());
}
renderedExampleTable.append(System.lineSeparator());
renderedExampleTable.append(RenderedExampleTable.descriptionFor(exampleTable));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import cucumber.runtime.io.MultiLoader
import cucumber.runtime.model.CucumberFeature
import spock.lang.Specification

import static net.thucydides.core.requirements.model.cucumber.ScenarioDisplayOption.WithTitle

class WhenReferencingScenariosInAFeatureNarrative extends Specification {

def featureFile = "src/test/resources/serenity-cucumber/features/maintain_my_todo_list/filtering_todos.feature"
Expand Down Expand Up @@ -44,11 +46,12 @@ class WhenReferencingScenariosInAFeatureNarrative extends Specification {

def "Should return the examples table alone for scenario outline if requested"() {
when:
def examples = ReferencedScenario.in(filteringTodoFeature).withName("Do many things").asExampleTable()
def examples = ReferencedScenario.in(filteringTodoFeature).withName("Do many things").asExampleTable(WithTitle)
then:
examples.isPresent()
and:
examples.get() == """### Do some things
| tasks | filter | expected |**{result:Filtering things I need to do!Do many things}**|
|-----------------------------|-----------|---------------|---|
| Buy some milk, Walk the dog | Completed | Walk the dog |{example-result:Filtering things I need to do!Do many things[0]}|
Expand All @@ -57,6 +60,7 @@ class WhenReferencingScenariosInAFeatureNarrative extends Specification {
[<i class="fa fa-info-circle"></i> More details](f5d0b08e3d3c0d0bf91e75595c812557a5edec10041ba70977bbead78fbdacf6.html)
### Do some other things
| tasks | filter | expected |**{result:Filtering things I need to do!Do many things}**|
|-----------------------------|-----------|---------------|---|
| Buy some milk, Walk the dog | Completed | Walk the dog |{example-result:Filtering things I need to do!Do many things[0]}|
Expand Down Expand Up @@ -101,15 +105,15 @@ class WhenReferencingScenariosInAFeatureNarrative extends Specification {
def "Should replace example references with the example table"() {
expect:
DescriptionWithScenarioReferences.from(filteringTodoFeature).
forText("{Examples} Do many things") == """### Do some things
forText("{Examples} Do many things") == """
| tasks | filter | expected |**{result:Filtering things I need to do!Do many things}**|
|-----------------------------|-----------|---------------|---|
| Buy some milk, Walk the dog | Completed | Walk the dog |{example-result:Filtering things I need to do!Do many things[0]}|
| Buy some milk, Walk the dog | Active | Buy some milk |{example-result:Filtering things I need to do!Do many things[1]}|
[<i class="fa fa-info-circle"></i> More details](f5d0b08e3d3c0d0bf91e75595c812557a5edec10041ba70977bbead78fbdacf6.html)
### Do some other things
| tasks | filter | expected |**{result:Filtering things I need to do!Do many things}**|
|-----------------------------|-----------|---------------|---|
| Buy some milk, Walk the dog | Completed | Walk the dog |{example-result:Filtering things I need to do!Do many things[0]}|
Expand Down

0 comments on commit 1c84f67

Please sign in to comment.