Getting undefined function error - but it is present

If you move the function definition outside of the describe/2 block, it will be available. You may want to check the documentation for describe/2, specifically the section on hierarchies, it may fit your needs.

I think there is probably a debate on whether or not what you are trying to do should be allowed.