Skip to content

Commit

Permalink
refactor test with oo-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RoRoche committed May 2, 2020
1 parent 2f3af92 commit 2fcab00
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
11 changes: 10 additions & 1 deletion src/test/groovy/com/github/roroche/BuiltProject.groovy
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
package com.github.roroche

class BuildProject {
import org.gradle.api.Project
import org.gradle.testfixtures.ProjectBuilder

@Singleton
class BuiltProject {
private final Project project = ProjectBuilder.builder().build()

public Project toProject() {
return project
}
}
32 changes: 17 additions & 15 deletions src/test/groovy/com/github/roroche/PlantUmlPluginTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ package com.github.roroche

import com.github.roroche.assertions.FindTaskAssertion
import com.github.roroche.assertions.ProjectWithPluginAssertion
import org.gradle.api.Project
import org.gradle.testfixtures.ProjectBuilder
import org.junit.jupiter.api.Test
import com.pragmaticobjects.oo.tests.TestCase
import com.pragmaticobjects.oo.tests.junit5.TestsSuite

class PlantUmlPluginTest {
@Test
void testPlantUmlPlugin() {
final Project project = ProjectBuilder.builder().build()
new ProjectWithPluginAssertion(
project,
"com.github.roroche.plantuml",
List.of(
new FindTaskAssertion(
project,
"buildClassDiagram"
class PlantUmlPluginTest extends TestsSuite {
PlantUmlPluginTest() {
super(
new TestCase(
"test applying PlantUmlPlugin declares buildClassDiagram task",
new ProjectWithPluginAssertion(
BuiltProject.instance.toProject(),
"com.github.roroche.plantuml",
List.of(
new FindTaskAssertion(
BuiltProject.instance.toProject(),
"buildClassDiagram"
)
)
)
)
).check()
)
}
}

0 comments on commit 2fcab00

Please sign in to comment.