SublimeText/RSpec — pull request #37 by ashmoran (2013-11-26 16:43:41+00:00)
Title: Merge recent improvements

Hi folks

I wanted some snippets and other improvements like `subject` and discovered that many of them other people have aleady made. I have quite a lot of time on my hands at the moment and I was feeling a bit gung-ho, so I spent today auditing and merging recent changes into one conflict-free branch.

I've gone through all the commits created this year, which is basically as much of the GitHub repo network graph fitted on my screen when I started. There aren't many commits before then, and I think they're almost all covered by more recent ones. I've merged most things, generally except where they're non-RSpec-core-related, contentious in some (usually minor) way, or conflict with something (and I just made a call).

Most things were straightforward to merge and seem like generally desirable improvements, so I thought this might form a useful line in the sand for future changes.

Here are the patches I've merged in, with some notes on any omissions, changes, or additions along the way:

@theodorton, @russen:

* `require 'spec_helper'` modernisation

@donaldevine:

* README update for Windows users (but this is overwritten by a later commit)

@enternships:

* Remove deprecated `should` helpers
* Updates to `it` helpers, *except* the change in this commit that replaces the memoized `let` helper with a Fabricator-specific one - this seems to removing generally applicable functionality and replacing it with something relevant only to Fabricator users
* Updates to `describe` and `context` helpers, *except* the change of the tab trigger from `des` to `desc`, which introduces a clash with the *describe controller* snippet
* I didn't merge the commit to remove snippets as someone else updated them, so maybe there enough users to justify keeping these

@kdurski:

* Remove the `should` helpers - the RSpec team doesn't want anyone to use these any more so it's probably correct to not facilitate it http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3
* I made some manual tweaks to the `describe` helpers in the spirit of commit https://github.com/kdurski/RSpec/commit/032244f0109c6e1b9f82e44796d24f7d74508e07 (the files they apply to have been renamed). Note: the `describe`/`it` helpers now all use double-quotes. This is probably an exercise in bikeshedding, but I wanted to make them all consistent, and the rspec-core spec files seem to prefer double quotes (although they're not 100% consistent about it themselves)

@epogue:

* I added a `let!` snippet manually as it was a copypaste job from the `let` one I already had in the repo. Note: I updated the language file to highlight this (and also `subject!` while I was at it).
* I added a `pending` snippet by hand so I could use the new .sublime-snippet format
* I've already merged/amended commits similar to the one to simplify `describe` etc

@ronny:

* `subject` snippet (Yay! This is what I started this whole exercise to get!)
* I'd aready made "should" be gone. Subjects don't "should" any more, they "do something".
* I left `(:each)` in the `before` snippet - it's still valid syntax, and if you don't want it you only have to backspace twice to get rid of it
* I merged the commit to add `open_rspec_file` as a Sublime command.I use RubyTest which also offers this feature, but the two don't appear to conflict.

@russCloak:

* I didn't merge the `should_receive` snippet commit as it also contained a snippet for `stub` (in the sense of an alias for `double`). Instead I added a snippet for `expect(…).to have_received`. I don't know if spies have become the preferred way of dealing with expectations yet: other uses of the `should` term are deprecated and I use spies almost exclusively, but if it turns out should_receive is still encouraged we can add a snippet later.

@paveldruzyak:

* I haven't merged the changes to the RSpec keywords, yet (someone else added `scenario` etc although I've lost track of which commit now). These aren't actually RSpec keywords as they come from Capybara, so I thought it better to defer adding these for now - I've been merging commits on the basis of what is provided by RSpec directly so far.

@stupied4ever:

* Heh, sorry, I ended up unifying the snippets on double-quotes. More recent commits in other people's forks had already changed these files, so I just looked to see what RSpec's own examples use more often when I merged those changes.

@gevans:

* A few snippet commits have been superseded by more recent ones
* Removed the Rails controller snippets (I assume these can be easily replicated with Rails generators and the standard RSpec snippets)

Me, at the end:

* Highlight `describe` when it appears as part of `RSpec.describe`
* Generic `expect { expression }.to something` snippet

Ash