Skip to content

Commit

Permalink
Merge pull request #391 from cliviu/master
Browse files Browse the repository at this point in the history
avoid duplicated test outcome in reports :
  • Loading branch information
YamStranger committed Apr 26, 2016
2 parents 30974e8 + 83793d4 commit cd3d541
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ class WhenExtractingTagsFromTestOutcomes extends Specification {
def outcome2 = TestOutcome.forTestInStory("someTest 2", Story.withId("1","story"))
def outcome3 = TestOutcome.forTestInStory("someTest 3", Story.withId("1","story"))
def outcome4 = TestOutcome.forTestInStory("someTest 4", Story.withId("1","story"))
def outcome5 = TestOutcome.forTestInStory("someTest 5", Story.withId("1","story"))

def release1 = TestTag.withName("PROJ Release 1").andType("version")
def release2 = TestTag.withName("PROJ Release 2").andType("version")
def iteration1 = TestTag.withName("Iteration 12").andType("version")
def iteration2 = TestTag.withName("Iteration 13").andType("version")
def iteration3 = TestTag.withName("Iteration 22").andType("version")
def issue1 = TestTag.withName("MyIssue").andType("issue")

def setup() {
outcome1.addTags([release1,iteration1])
outcome2.addTags([release1, iteration1])
outcome3.addTags([release1, iteration2])
outcome4.addTags([release2, iteration3])
outcome5.addTags([issue1])
def issues = new ArrayList<String>();
issues.add("MyIssue");
outcome5.addIssues(issues);
}

def "should extract tags from test outcomes"() {
Expand All @@ -45,4 +51,13 @@ class WhenExtractingTagsFromTestOutcomes extends Specification {
then:
iterations == [iteration1, iteration2]
}

def "should not create duplicate test issue outcomes"() {
given:
def outcomes = TestOutcomes.of([outcome1, outcome2, outcome3, outcome4, outcome5])
when:
outcomes = outcomes.withTag(issue1);
then:
outcomes.getOutcomes().size() == 1
}
}

0 comments on commit cd3d541

Please sign in to comment.