describe vs context in rspec. Differences? [duplicate]

白昼怎懂夜的黑 提交于 2019-12-04 23:04:22
Leo Correa

There is not much difference between describe and context. The difference lies in readability. I tend to use context when I want to separate specs based on conditions. I use describe to separate methods being tested or behavior being tested.

One main thing that changed in the latest RSpec is that "context" can no longer be used as a top-level method.

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