[rspec-users] Strange behaviour with pending specs and implementation_backtrace

Andreas Wolff treas at dynamicdudes.com
Tue Jul 8 04:59:58 EDT 2008

Hi all,

I'm using my own OutputFormatter with /bin/spec to catch rspec results. I'm experiencing strange behaviour with pending specs and implementation_backtrace.
This is my example_pending implementation in rspactor_formatter.rb:

class RSpactorFormatter
  def example_pending(example, message)
    spec = SpecObject.new(
      :name               => example.description,
      :example_group_name => @example_group.description,
      :state              => :pending,
      :message            => message,
      :backtrace          => example.implementation_backtrace
    @remote_service.incoming(:spec_run_example_pending, spec)

If my code contains a pending example in test_spec.rb like this:

it 'should be pending' do

'example.implementation_backtrace' contains the correct file path.

If I change the implementation to:

it 'should be pending'

'example.implementation_backtrace' doesn't contain the correct file path anymore. Instead the backtrace ends with my custom formatter file 'rspactor_formatter.rb'.

Is this behaviour correct? Am I something missing?


Andreas Wolff

Lightweight Ruby on Rails application development
hire: +49 151 58 54 78 50

home: http://rubyphunk.com

More information about the rspec-users mailing list