describe vs context in rspec. Differences? [duplicate]

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.

Leave a Comment