Skip to content

Commit

Permalink
Merge pull request #1162 from sethp-nr/bugfix/description-setter-buil…
Browse files Browse the repository at this point in the history
…d-step

DescriptionSetter: Omit description when empty
  • Loading branch information
daspilker authored Apr 26, 2019
2 parents 9b343ee + 3cd1966 commit 31690d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ class StepContext extends AbstractExtensibleContext {
void buildDescription(String regexp, String description = null) {
stepNodes << new NodeBuilder().'hudson.plugins.descriptionsetter.DescriptionSetterBuilder' {
delegate.regexp(regexp ?: '')
delegate.description(description ?: '')
if (description) {
delegate.description(description)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ class StepContextSpec extends Specification {
then:
with(context.stepNodes[0]) {
name() == 'hudson.plugins.descriptionsetter.DescriptionSetterBuilder'
children().size() == 2
children().size() == 1
regexp[0].value() == '[version] (.*)'
description[0].value() == ''
}
1 * jobManagement.requireMinimumPluginVersion('description-setter', '1.9')
}
Expand Down

0 comments on commit 31690d6

Please sign in to comment.