rspec/rspec-core — Issue #544: Detecting when you accidentally write a spec inside a `describe` block?
Author: dbalatero
Created: 2011-12-23 22:34:06+00:00
State: open

Hey @dchelimsky,

One thing that happens to me semi-occasionally is writing a spec instead of a `describe` block, and not realizing that I'm missing an `it`:

```ruby
describe MyClass do
describe "#some_method" do
subject.some_method.should == :foo # doh!
end
end
```

I always spend 5-10 minutes scrutinizing your code, until that "a ha" moment when I realize I did something dumb :) But it's a hard bug to detect, much like mismatched `begin/end` blocks or curly braces.

I'm wondering if there's any interest in figuring out how to detect missing `it` blocks, so as to give people better error messages?

If this is a feature that you don't want, I don't want to spend time researching how to do it, but if it would be useful I'd be willing to go down that rabbit hole.

Thanks!