Re: [rspec-users] feedback on matcher

2011-01-27 Thread Mike Mazur
Hi, On Thu, Jan 27, 2011 at 21:48, Michael Guterl wrote: > RSpec::Matchers.define :deliver do |message| >  chain :with do |*args| >    @with = args >  end > >  match do |mailer| >    mail = double >    mail.should_receive(:deliver) > >    mailer.should_receive(message).with(*@with).and_return(mai

Re: [rspec-users] feedback on matcher

2011-01-27 Thread Michael Guterl
On Thu, Jan 27, 2011 at 2:05 PM, Michael Guterl wrote: > On Thu, Jan 27, 2011 at 10:30 AM, David Chelimsky > wrote: >> >> On Jan 27, 2011, at 7:48 AM, Michael Guterl wrote: >> >>> We have moved from Rails 2 to 3 and the changing Mailer syntax has >>> caused us to rewrite some of our specs. >>> >

Re: [rspec-users] feedback on matcher

2011-01-27 Thread Michael Guterl
On Thu, Jan 27, 2011 at 10:30 AM, David Chelimsky wrote: > > On Jan 27, 2011, at 7:48 AM, Michael Guterl wrote: > >> We have moved from Rails 2 to 3 and the changing Mailer syntax has >> caused us to rewrite some of our specs. >> >> In Rails 2: >> >> Implementation: >>  Mailer.deliver_job_applicat

Re: [rspec-users] feedback on matcher

2011-01-27 Thread Michael Guterl
On Thu, Jan 27, 2011 at 10:30 AM, David Chelimsky wrote: > > On Jan 27, 2011, at 7:48 AM, Michael Guterl wrote: > >> We have moved from Rails 2 to 3 and the changing Mailer syntax has >> caused us to rewrite some of our specs. >> >> In Rails 2: >> >> Implementation: >>  Mailer.deliver_job_applicat

Re: [rspec-users] feedback on matcher

2011-01-27 Thread David Chelimsky
On Jan 27, 2011, at 7:48 AM, Michael Guterl wrote: > We have moved from Rails 2 to 3 and the changing Mailer syntax has > caused us to rewrite some of our specs. > > In Rails 2: > > Implementation: > Mailer.deliver_job_application(job.id, user.id) > > Spec: > Mailer.should_receive(:deliver_j

[rspec-users] feedback on matcher

2011-01-27 Thread Michael Guterl
We have moved from Rails 2 to 3 and the changing Mailer syntax has caused us to rewrite some of our specs. In Rails 2: Implementation: Mailer.deliver_job_application(job.id, user.id) Spec: Mailer.should_receive(:deliver_job_application).with(@job.id, @user.id) --- In Rails 3: Implementati