thoughtbot / shoulda-context

Shoulda Context makes it easy to write understandable and maintainable tests under Minitest and Test::Unit within Rails projects or plain Ruby projects.
MIT License
239 stars 58 forks source link

Original test backtrace should be preserved #9

Closed y8 closed 12 years ago

y8 commented 12 years ago

Hey.

Right now shoulda-context breaking backtrace:

SKIP test: Something happend.  (0:00:00.465)
     Test me!

     gems/shoulda-context-2f8fad6003da/lib/shoulda/context/context.rb:398:in `call'
     gems/shoulda-context-2f8fad6003da/lib/shoulda/context/context.rb:398:in `block in create_test_from_should_hash'
     gems/activesupport-3.2.0/lib/active_support/testing/setup_and_teardown.rb:35:in `block in run'
     gems/activesupport-3.2.0/lib/active_support/callbacks.rb:425:in `_run__2556407847287019068__setup__2472431954389510972__callbacks'
     gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
     gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
     gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
     gems/activesupport-3.2.0/lib/active_support/testing/setup_and_teardown.rb:34:in `run'

This is not good. Shoulda should preserve original path to block in backtrace (should { } in *_test.rb)

travisjeffery commented 12 years ago

I tried several different ways of raising, failing and busting the backtrace and could not do it, neither have I came across this issue before as far as I can recall.

So could you give me a reproducible test and how you instantiated the test from the command-line.

travisjeffery commented 12 years ago

I haven't been able to reproduce this, and you haven't responded or given by any idea on how to reproduce this so until then this issue is closed.

nixme commented 12 years ago

For anyone googling this issue and ending up here, the culprit is the turn gem. Upgrade to the latest turn and backtraces are no longer clobbered.

cseelus commented 9 years ago

@y8 and anyone else who has this problem:

This is probably a minitest-reporters problem with all but the default reporter, which is even mentioned directly in the README.

y8 commented 9 years ago

@cseelus huh, since "jarrett authored on Aug 29, 2014". :) But thanks anyway!