On Oct 10, 2011, at 8:17 PM, Patrick J. Collins wrote:

> I know I can do:
> 
> blah.should be_empty
> 
> or
> 
> 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

See

https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/be-matchers

and

https://www.relishapp.com/rspec/rspec-expectations/docs/custom-matchers/define-matcher

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to