[rspec-users] understanding rspec predicates

Patrick J. Collins patrick at collinatorstudios.com
Mon Oct 10 21:17:38 EDT 2011

I know I can do:

blah.should be_empty


blah.should have_key(:to_my_house)


But, is there a way to do:

str = "lmaonade omg rotfcopter!"

str.should start_with("lmao")

Or is it just best to do:

str.starts_with?("lmao").should be_true


Patrick J. Collins

More information about the rspec-users mailing list