Skip to content

Commit

Permalink
refactor: add missing test case for #1347
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Linkowski committed Dec 9, 2022
1 parent 70280c8 commit 21af9f5
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import au.com.dius.pact.core.model.matchingrules.MinMaxTypeMatcher
import au.com.dius.pact.core.model.matchingrules.NullMatcher
import au.com.dius.pact.core.model.matchingrules.RegexMatcher
import au.com.dius.pact.core.model.matchingrules.TypeMatcher
import au.com.dius.pact.core.model.matchingrules.ValuesMatcher
import kotlin.Triple
import spock.lang.Issue
import spock.lang.Specification
Expand Down Expand Up @@ -291,6 +292,20 @@ class MatchingContextSpec extends Specification {
category << [ 'header', 'query', 'metadata' ]
}

@Issue('#1347')
def 'values matcher must not cascade'() {
given:
def matchingRules = new MatchingRuleCategory('body')
matchingRules.addRule('$', ValuesMatcher.INSTANCE)
def context = new MatchingContext(matchingRules, true)

when:
def rules = context.selectBestMatcher(['$', 'id'])

then:
rules.rules == []
}

@Issue('#1367')
def 'array contains matcher with simple values'() {
given:
Expand Down

0 comments on commit 21af9f5

Please sign in to comment.