rubocop / rspec-style-guide

Best practices for writing your specs!
http://rspec.rubystyle.guide
958 stars 118 forks source link

Update wording for when to use `expect` syntax #91

Closed andyw8 closed 5 years ago

andyw8 commented 5 years ago

Since it's been around for almost 7 years, it doesn't make sense to refer to the expect syntax as 'new'.

http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/

bbatsov commented 5 years ago

I wonder if someone's on RSpec 2 at this point. Perhaps we can just say at the beginning the guide targets RSpec 3+?

pirj commented 5 years ago

Updating to RSpec 3 is mostly painless and the procedure is described here. Agree that it makes sense to target the latest version in the guide, especially in this recommendation. I can't imagine someone starting a new project with an older RSpec.

What do you think of rewording this to:

Always use the `expect` syntax.

since older projects may include legacy code, and should syntax is still supported in RSpec 3.

bbatsov commented 5 years ago

👍

andyw8 commented 5 years ago

Updates as per the suggestions.

bbatsov commented 5 years ago

Thanks!