Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rspec syntax to use 'expect' and also change '==' to 'eq' and '=~' to 'match' #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

durrantm
Copy link

Updated specs to use expect syntax.
As you may well know, 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 acquainted with it."
I noticed that expect is now being used in many of the major gems that use rspec.
I changed the pattern matchers from =~ to match() or match_array() as required for this change and while at it I also took the opportunity to change the == format to eq as recommended in the post.
All previously passing tests still pass after this change.
I have tried to observe the existing style. The only exception is some blank spaces on empty lines - but I kept the empty lines themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant