How to create a negative test for a verifier
Hi, I'm working on adding some verifiers to the transformer for the Ash Neo4j DataLayer, and I've got a simple Verifier that checks neo4j convention on the resource label
Here is the verifier:
Here is an invalid resource, the neo4j (node) label for the InvalidLabel resource should be :Comment not :comment
I'm at a loss how to write a negative test, as the module simply doesn't compile. Ideally I'd like to delay compilation until in the unit test, and pass the test if it errors.
Help appreciated.
3 Replies
Solution
Define the module inside the test block
And wrap that in
assert_raise
GitHub
ash/test/resource/aggregates_test.exs at 7043e5a2cb2c2d8557aa1303dd...
A declarative, extensible framework for building Elixir applications. - ash-project/ash