Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
400 views
in Technique[技术] by (71.8m points)

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

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'
   undefined method `locale' for #
   # ./spec/controllers/segments_controller_spec.rb:14:
      in `block (3 levels) in '

This is normal as I do have an error :)

The problem is that the trace isn't very helpful. I know it broke in segments_controller_spec.rb, line 14, but this is just where I call the test:

### segments_controller_spec.rb:14
get 'index'

I would prefer to have the actual line breaking and the complete trace, not the part in the spec folder.

Running with --trace doesn't help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You must run rspec with -b option to see full backtraces


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...