Re: [rspec-users] syntax for custom messages

2012-03-05 Thread ruud144
Thank you for your explanation! Ruud On Mar 5, 3:10 pm, David Chelimsky wrote: > On Mon, Mar 5, 2012 at 2:18 AM, ruud144 wrote: > > hi group, > > > I read that expectations can print a custom message on failure using a > > syntax like > > > cars.should be_empty, "Cars left" > > > But when I try

Re: [rspec-users] syntax for custom messages

2012-03-05 Thread Justin Ko
On Mar 5, 2012, at 1:18 AM, ruud144 wrote: > hi group, > > I read that expectations can print a custom message on failure using a > syntax like > > cars.should be_empty, "Cars left" This is because RSpec predicate matchers can accept a block: https://github.com/rspec/rspec-expectations/blob/ma

Re: [rspec-users] syntax for custom messages

2012-03-05 Thread David Chelimsky
On Mon, Mar 5, 2012 at 2:18 AM, ruud144 wrote: > hi group, > > I read that expectations can print a custom message on failure using a > syntax like > > cars.should be_empty, "Cars left" > > But when I try this syntax for this expectation: > > string.should == 'Cars left', 'Yippee, no cars anymore'

[rspec-users] syntax for custom messages

2012-03-05 Thread ruud144
hi group, I read that expectations can print a custom message on failure using a syntax like cars.should be_empty, "Cars left" But when I try this syntax for this expectation: string.should == 'Cars left', 'Yippee, no cars anymore' I get a syntax error: syntax error, unexpected ',', expecting