Skip to content

Commit

Permalink
Make sure items in paket references are trimmed (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurelol committed Apr 8, 2021
1 parent 085c6c3 commit a8e30b7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Expand Up @@ -30,7 +30,7 @@ class PaketUnityReferences {
referencesContent.eachLine { line ->

if(!line.empty){
nugets << line
nugets << line.trim()
}
}
}
Expand Down
@@ -0,0 +1,25 @@
package wooga.gradle.paket.base.utils.internal

import spock.lang.Shared
import spock.lang.Specification
import spock.lang.Unroll
import wooga.gradle.paket.base.utils.internal.PaketTemplate

class PaketUnityReferencesSpec extends Specification {

@Unroll
def "ensure items are trimmed"() {

when:
def refs = new PaketUnityReferences(content)

then:
refs.nugets == nugets

where:
content | nugets
"A1\nA2\nA3\n" | ["A1", "A2", "A3"]
" A1 \nA2\nA3\n" | ["A1", "A2", "A3"]
" A1 \n A2 \nA3 \n" | ["A1", "A2", "A3"]
}
}

0 comments on commit a8e30b7

Please sign in to comment.