Skip to content

Commit

Permalink
Fix Issue #168: typo in build method
Browse files Browse the repository at this point in the history
  • Loading branch information
kmanning committed Oct 30, 2019
1 parent 70161af commit 7e7a19e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BuildStage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BuildStage implements Stage, TerraformEnvironmentStagePlugin {
}

public void build() {
Jenkinsflie.build(pipelineConfiguration())
Jenkinsfile.build(pipelineConfiguration())
}

@Override
Expand All @@ -44,7 +44,7 @@ class BuildStage implements Stage, TerraformEnvironmentStagePlugin {
}
}

private Closure pipelineConfiguration() {
protected Closure pipelineConfiguration() {
applyPlugins()

return {
Expand Down
23 changes: 23 additions & 0 deletions test/BuildStageTest.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import org.junit.*
import org.junit.runner.RunWith
import de.bechte.junit.runners.context.HierarchicalContextRunner

import static org.mockito.Mockito.verify
import static org.mockito.Mockito.when
import static org.mockito.Mockito.spy
import static org.mockito.Mockito.doReturn

@RunWith(HierarchicalContextRunner.class)
class BuildStageTest {

public class Build {
@Test
void buildsWithoutError() {
BuildStage stage = spy(new BuildStage())

doReturn({ -> }).when(stage).pipelineConfiguration()

stage.build()
}
}
}

0 comments on commit 7e7a19e

Please sign in to comment.