Skip to content

Commit

Permalink
actually writeReadme when testing
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Dec 4, 2024
1 parent 72ae6a3 commit 30a72fb
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions plugins/nf-quilt/src/test/nextflow/quilt/QuiltProductTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,19 @@ class QuiltProductTest extends QuiltSpecification {
!product.match('temp.txt')
}

void 'writeSummarize empty if no files are present'() {
given:
QuiltProduct product = makeProduct('readme=SKIP')
product.pkg.reset()
expect:
!product.match('*.md')
product.writeSummarize() == []
}

void 'overrides default README with config'() {
when:
QuiltProduct defaultREADME = makeProduct()
String text = defaultREADME.compileReadme('msg')
String text = defaultREADME.writeReadme('msg')
def files = defaultREADME.match('*')

then:
Expand All @@ -202,27 +211,19 @@ class QuiltProductTest extends QuiltSpecification {
when:
String readme_text = 'hasREADME'
QuiltProduct hasREADME = makeProduct("readme=${readme_text}")
text = hasREADME.compileReadme('msg')
text = hasREADME.writeReadme('msg')
files = hasREADME.match('*')
then:
text == readme_text
!hasREADME.shouldSkip(QuiltProduct.KEY_README)
files.size() > 0
}

void 'writeSummarize empty if no files are present'() {
given:
QuiltProduct product = makeProduct('readme=SKIP')
product.pkg.reset()
expect:
!product.match('*.md')
product.writeSummarize() == []
}

void 'should create summarize if files are present'() {
String readme_text = 'hasREADME'
QuiltProduct product = makeProduct("readme=${readme_text}")
product.compileReadme('msg')
product.writeReadme('msg')
product.match('*.md')
List<Map> quilt_summarize = product.writeSummarize()
expect:
Expand Down

0 comments on commit 30a72fb

Please sign in to comment.