Add the TestCommandFactory with a getTestMethods.

This commit is contained in:
2023-09-20 22:23:18 +03:00
parent 9edbca09cf
commit 08c85459a7
2 changed files with 62 additions and 0 deletions
@@ -0,0 +1,22 @@
package space.kklochko.simple_jbdd.tests.factories
import space.kklochko.simple_jbdd.test_examples.tests.SimpleThenTest
import space.kklochko.simple_jbdd.tests.factories.TestCommandFactory;
import spock.lang.Specification
class TestCommandFactorySpec extends Specification {
def "If the map of methods have one test block."() {
given: "I have a TestCommandFactory object"
def factory = new TestCommandFactory();
and: "I also have a SimpleThenTest object"
def simpleThenTest = new SimpleThenTest()
when: "If a test have only one block"
def map = factory.getTestMethods(simpleThenTest.getClass())
then: "the map size is 1 method"
1 == map.size()
}
}