I have a bit of a conceptional question I hope peo...
# test
j
I have a bit of a conceptional question I hope people can help me with. I have been looking at Kotlin DSLs a lot lately, particularly how they relate to building state machines. I think the DSLs are great and very useful for setting up complex objects in a readable way, but they seem to be a nightmare for testing. All your functionality is bundled in one place, you have no concrete implementation of objects that can be dealt with atomicly, whatever objects are created using the DSL need to be made public by whatever class they were created in (which is always a testing red flag), and all the objects created seem to need to be tested in an "all or nothing" manner. Is there something I'm missing? Am I overthinking these issues? I couldn't really find any good examples of testing the usage of a DSL (since a Google search of "kotlin dsl unit test" mostly just comes up with test frameworks that incorporate a DSL). Does anyone have any good examples of how you would go about testing this is a safe and proper way?