How to get rspec-2 to give the full trace associated with a test failure?

后端 未结 6 2022
独厮守ぢ
独厮守ぢ 2020-12-13 05:21

Right now if I run my test suite using rake spec I get an error:

1) SegmentsController GET \'index\' should work
   Failure/Error: get \'index\'
   u         


        
6条回答
  •  孤街浪徒
    2020-12-13 06:01

    I don't know how to get the controller error to show up in rspec. Sometimes it shows up but I don't know what conditions cause it to show up. Here is a way to see the error fairly quickly though:

    Open another terminal session and run:

    tail -f log/test.log
    

    Then go back to the terminal session and run just the spec that had the error:

    bin/rspec -b spec/requests/posts/index_spec.rb
    

    Go back to the tail of the log and you should see the error, hopefully without too much other stuff surrounding it (because you ran the failing test by itself).

提交回复
热议问题