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'

Re: [rspec-users] what RSpec approach could I use for this.

2012-03-05 Thread Justin Ko
On Mar 5, 2012, at 5:05 AM, Andrew Premdas wrote: > > On 3 March 2012 21:55, Greg C. wrote: > Background: So I have roughly: > > class A > def calculate_input_datetimes > # do stuff to calculate datetimes - then for each one identified > process_datetimes(my_datetime_start, my_dat

[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

Re: [rspec-users] what RSpec approach could I use for this.

2012-03-05 Thread Andrew Premdas
On 3 March 2012 21:55, Greg C. wrote: > Background: So I have roughly: > > class A > def calculate_input_datetimes > # do stuff to calculate datetimes - then for each one identified > process_datetimes(my_datetime_start, my_datetime_end) > end > > My thoughts on this is that this m