vim-rails
vim-rails copied to clipboard
supporting new rspec template
@tpope: was looking at doing a PR for the new rspec template (specifically, after describe x, add , type: :sym, where sym is :controller, :model, or similar.
what do you think?
one thing i'm not sure about is how to maintain rspec 2 and rspec 3 parity.
My first question would be if this type: ... annotation is required on RSpec 3, and if it's forbidden on RSpec 2. If we can get away with supporting just one of the two styles, I'd rather do that.
Second, is there a particular gem we can check for that will only be present with RSpec 3? There's a trend towards increasing granularity and hooking onto a gem's presence is easier to reliably do than checking a version.
The type is not required in rspec 3. The dependencies of version 2.99 and 3.0 are the same though, so I am not sure about the gem portion.
I think rspec-support can be used as a proxy to see if someone has 2.99, 3.0, or later. The gem was not a runtime dependency of RSpec 2.14. Since 2.99 is meant to be used for easier migration from 2.x to 3.x, we should treat 2.99 as if it's 3.x anyway.