vim-rails icon indicating copy to clipboard operation
vim-rails copied to clipboard

supporting new rspec template

Open imajes opened this issue 11 years ago • 3 comments
trafficstars

@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.

imajes avatar Aug 14 '14 17:08 imajes

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.

tpope avatar Aug 15 '14 20:08 tpope

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.

brandoncc avatar Jan 18 '15 17:01 brandoncc

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.

geoffharcourt avatar Apr 23 '15 14:04 geoffharcourt