Testing for a a new file using Rspec


#1

Hi,

I am new to Rspec so i am not sure if this can be done. I want to
write a test that the outcome of a function is that a new file is
successfully created in a directory. The test would be somthing like
“it should save the xml to a file in /path/foo”.

Can this be done? If so how is it done? (I am guessing it would be a
clause in the “after” method.

Regards,
Beriahotep


#2

Beriahotep wrote:

Hi,

I am new to Rspec so i am not sure if this can be done. I want to
write a test that the outcome of a function is that a new file is
successfully created in a directory. The test would be somthing like
“it should save the xml to a file in /path/foo”.

Can this be done? If so how is it done? (I am guessing it would be a
clause in the “after” method.

It’s not what you’re searching for, but can be a start line. :slight_smile:

http://cassiomarques.wordpress.com/2009/01/23/how-to-test-file-uploads-with-cucumber/

Hth,

Davi V.