<@U0EACPP46> I'm thinking of moving the examples o...
# minutest
d
@natpryce I'm thinking of moving the examples over to JUnitTests, but that is quite a commitment. How is it working for you?
n
It’s working out fine
d
I’m a bit conflicted. I’ve added some simpler examples to the start of the readme and it makes those simpler, but as soon as you have a test-specific fixture it’s a pain that you need to define it outside the object - so now I have to explain the two methods.
n
You don’t need to define it outside the object
Just outside the block that you pass to the constructor
Define a nested class in the body of the object and you can refer to it within the block
d
Ah, thanks, I’ll recast the examples.
Although I suppose then the fixture ends up after all the test code.
n
It does, which is a bit weird.
I’ve been a “main method at the bottom of the file” person since my C programming days
d
How about this
Copy code
object NewFixtureExampleTests : JUnitTests<Fixture>() {

    class Fixture {
        val stack1 = Stack<String>()
        val stack2 = Stack<String>()
    }

    override val tests = tests {
        fixture { Fixture() }

        test("swap top") {
...        }
    }
}
n
If that’s an optional override, yeah!
As in, pass a block to the closure as a shortcut
d
I'm going to make that one JUnitFixtureTests, leaving the old one alone
n
👍