How to get current file name passed in as argument

44 views
Skip to first unread message

Ankita@Adslot

unread,
Jul 8, 2013, 12:15:47 AM7/8/13
to rs...@googlegroups.com
I want to pass in current file name inside rspec code where in if the code fails, it would save a screen shot with the file name where it failed.

Not sure how to pass current file name in rspec.

Any help is really appreciated!

Arun Sakthivel

unread,
Jul 8, 2013, 12:20:23 AM7/8/13
to rs...@googlegroups.com
Hi,

Save file in /spec/fixtures/files

In controller like
 get 'update_logo', {id: id, business: { :logo => fixture_file_upload("/files/logo.jpg", 'image/jpg') }}

Thanks & Regards,
S.Arun



--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/6973014d-ae1f-467e-b73c-ad02312cfa4a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ankita

unread,
Jul 8, 2013, 1:43:35 AM7/8/13
to rs...@googlegroups.com
Hi Arun

Thanks for the information, but, it does not solve my purpose.
As I wanted to use like a method where in I could get the current file name and use it anywhere I want in the code

For example, I am writing have 3 files <script1.rb, script2.rb, script3.rb>
and I would like to output a message at the end of execution of all the scripts where in the message says something like "Tested $filename (where it will pass name of file from script1.rb, script2.rb, script3.rb)"






The information transmitted may be confidential, is intended only for the person to which it is addressed, and may not be reviewed, retransmitted, disseminated or relied upon by any other persons. If you received this message in error, please contact the sender and destroy any paper or electronic copies of this message. Any views expressed in this email communication are those of the individual sender, except where the sender specifically states otherwise. Adslot Pty Ltd does not represent, warrant or guarantee that the communication is free of errors, virus or interference.


Arun Sakthivel

unread,
Jul 9, 2013, 12:42:16 AM7/9/13
to rs...@googlegroups.com

Ankita

unread,
Jul 9, 2013, 1:00:22 AM7/9/13
to rs...@googlegroups.com
Thanks for the information Arun.



Reply all
Reply to author
Forward
0 new messages