applicationsonline/librarian — pull request #156 by durrantm (2013-11-28 19:40:40+00:00)
Title: Update rspec to use expect syntax.  Also change == to eq and =~ to match or match_array

Hi, I'd like to offer this suggestion for changes to the RSpec syntax to use expect. I noticed that some of the more recent specs in this gem have started to use it already (e.g. unit/dependency_spec.rb or unit/environment_spec.rb), so this change would make the usage consistent throughout the test suite. More than just a style change, it has turned turned out that using 'expect' over 'should' is a recommended practice because of dealing with delegate/proxy objects as detailed in http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax.
As detailed in the blog post "In the future, we plan to change the defaults so that only expect is available unless you explicitly enable should. We may do this as soon as RSpec 3.0, but we want to give users plenty of time to get acquianted with it." I've also noticed that many of the major github gems have already made the move. It also helps the spec and the error reporting readability be more english like.
I changed the pattern matchers from =~ to match() as required for this change and while at it I also took the opportunity to change the '==' operator to 'eq' as recommended in the post.
All tests pass.