How can I use my specs for their intended purposes if they are in a separate namespace?

Deadly 提交于 2019-12-03 02:18:01

This question demonstrates an important distinction between specs used within an application and specs used to test the application.

Specs used within the app to conform or validate input — like :example.core/config here — are part of the application code. They may be in the same file where they are used or in a separate file. In the latter case, the application code must :require the specs, just like any other code.

Specs used as tests are loaded after the code they specify. These are your fdefs and generators. You can put these in a separate namespace from the code — even in a separate directory, not packaged with your application — and they will :require the code.

It's possible you have some predicates or utility functions that are used by both kinds of specs. These would go in a separate namespace all of their own.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!