[rspec-users] Do you think it would look cleaner?

Gaston Ramos gramos at rectorado.unl.edu.ar
Sat Dec 29 10:44:31 EST 2007


El sáb, 29 de dic de 2007, a las 02:00:25 -0500, Andrew WC Brown dijo:
> I was looking over some of my specs.
> I was thinking that the following:
> 
> @game.should_receive(:name).and_return('The Battle for Blaze')
> @game.should_receive(:people).and_return(5000000)
> @game.should_receive(:activated).and_return(true)
> 
> Would it look cleaner if I could do this instead?
> 
> @game.should_recieve_and_return(
>   :name => 'The Battle for Blaze'
>   :people => 5000000
>   :activated => true)
> 
> Opinions?

Hi Andrew, I think the first option is more clearer and more expresive
than then 2nd. one.

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

-- 
Gastón Ramos

"I always thought Smalltalk would beat Java, I just didn't know it would be
 called 'Ruby' when it did."

-- Kent Beck

GNU/Linux Counter user #450312
http://gastonramos.wordpress.com/

No a la Matricula Obligatoria 
http://noalamatricula.wordpress.com/about/


More information about the rspec-users mailing list