[rspec-users] Problems with array mock

Gaston Ramos gramos at rectorado.unl.edu.ar
Mon Aug 6 13:17:15 EDT 2007


Hi everyone,

I'm trying this in my helper spec and it didn't work:

@curr_odontogram.should_receive('photos[1]').and_return(@photo)

and the error is:

SyntaxError in 'PersonHelper Deberia devolverme un link para eliminar una foto'
compile error
/home/gramos/src/rails/r-dental/config/../vendor/plugins/rspec/lib/spec/mocks/proxy.rb:99:
syntax error, unexpected '[', expecting '\n' or ';'
          def photos[1](*args, &block)

does anyone have a good solution for this?

the complete code of the helper:

http://pastie.caboo.se/85287

the complete code of the spec helper:

http://pastie.caboo.se/85289


See you.
-- 
Gastón Ramos

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