I use ExUnit to test my Elixir application, which is a card game.
I find that with every test I write, I start by creating a new deck of cards.
test "Do This Crazy Thing do
deck = Deck.create()
[...]
end
test "Do This Other Crazy Unrelated Thing" do
deck = Deck.create()
[...]
end
Is there a way to explain this so that a new deck can only be created before each test case? I know something close to this with setup do [...] end, but I don't think the solution is for me.
Do I need another test environment? Should I use it setupin some way that I haven't thought about?
-Augie
source
share