[LRUG] Writing readable feature tests with RSpec

Kerry Buckley kerryjbuckley at gmail.com
Thu Jul 31 02:53:47 PDT 2014


On 31 July 2014 at 10:52:02, Frederick Cheung (frederick.cheung at gmail.com) wrote:
On 31 July 2014 at 10:38:22, Kerry Buckley (kerryjbuckley at gmail.com) wrote: 
> 
> I’ve never been particularly offended by rspec’s “magic”, but looking at your example 
> another potential cause of confusion occurred to me, namely that these two expectations 
 > are not equivalent: 
> 
> expect(foo).to be_true # passes for anything truthy 
> expect(foo).to be true # passes only if TrueClass === foo 

Which is why rspec 3 removed be_true (and replaced it with be_truthy) 
Yeah, should have checked that the version of rspec in my default gemset was up-to-date when I tried it out :-/

Kerry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20140731/9fd9d14e/attachment-0003.html>


More information about the Chat mailing list