Hello Mohit,

I did not find an answer specifically for the case I mentioned

But the approach you suggest seems to be ok for me. I will try that

thank you
Joao


On Mon, Jun 21, 2021 at 1:07 PM Mohit Sindhwani <[email protected]> wrote:

> Hi Joao,
>
> Did you find an answer?
>
> On 2021-6-11 11:30 pm, Joao Miguel Ferreira wrote:
> > Hello all,
> >
> > Is there a way to ask rspec to print the path of the file from which
> > tests are being run?
>
> Today, while reading the 'Effective Testing with RSpec 3' book, I found
> that you can access metadata in the context level:
>
> RSpec.describe 'My Exciting Class' do
>    puts metadata
>
>    context 'when condition' do
>      it 'succeeds' do
>      end
>    end
> end
>
> The metadata outputs a bunch of stuff, including :file_path and
> :absolute_file_path
>
> Hope this helps.
>
> Best Regards,
> Mohit.
> 2021-6-21 | 8:07 pm.
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/CALyyT7SHa2RW3O5mBUE4KuRUaBQoSC9_Nj4axxEFddn%2BeJL0EA%40mail.gmail.com.

Reply via email to