Skip to content

Commit

Permalink
Updated tests to correctly assert on displayName or name
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-molak committed Jan 4, 2024
1 parent 84e1349 commit 8978ef5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WhenGeneratingRequirementsReportData extends Specification {

List<RequirementsTagProvider> requirementsProviders
ReportNameProvider reportNameProvider

def setup() {
FeatureCache.getCache().close()
def vars = new MockEnvironmentVariables()
Expand All @@ -49,10 +49,10 @@ class WhenGeneratingRequirementsReportData extends Specification {
RequirementsOutcomes outcomes = requirmentsOutcomeFactory.buildRequirementsOutcomesFrom(noTestOutcomes)
then: "all the known capabilities should be listed"
def requirementsNames = outcomes.requirementOutcomes.collect {it.requirement.name}
requirementsNames == ["Grow cucumbers", "Grow potatoes", "Grow wheat", "Raise chickens", "Apples", "Nice zucchinis", "Potatoes"]
requirementsNames == ["grow cucumbers", "Grow potatoes", "Grow wheat", "raise_chickens", "Apples", "Nice zucchinis", "Potatoes"]
and: "the display name should be obtained from the narrative file where present"
def requirementsDisplayNames = outcomes.requirementOutcomes.collect {it.requirement.displayName}
requirementsDisplayNames == ["Grow cucumbers", "Grow lots of potatoes", "Grow wheat", "Raise chickens", "Apples", "Nice zucchinis", "Potatoes title"]
requirementsDisplayNames == ["Grow cucumbers", "Grow potatoes", "Grow wheat", "Raise chickens", "Apples", "Nice zucchinis", "Potatoes title"]
}

def "should report no test results for requirements without associated tests"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class WhenLoadingRequirementDefinitionDescriptionFromADirectory extends Specific
then: "the narrativeText should be found"
narrative.present
and: "the narrativeText title and description should be loaded"
narrative.get().title.get() == "Grow more apples"
narrative.get().title.get() == "Grow apples"
narrative.get().text.contains("In order to make apple pies") &&
narrative.get().text.contains("As a farmer") &&
narrative.get().text.contains("I want to grow apples")
Expand Down

0 comments on commit 8978ef5

Please sign in to comment.