Strange behaviour with pending specs and implementation_backtrace

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)
end
end

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

it ‘should be pending’ do
pending
end

‘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?

bye


Andreas W.
DynamicDudes

Lightweight Ruby on Rails application development
http://dynamicdudes.com
hire: +49 151 58 54 78 50

home: http://rubyphunk.com

On Jul 8, 2008, at 3:59 AM, Andreas W. wrote:

 :name               => example.description,

If my code contains a pending example in test_spec.rb like this:
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?

It’s a bug. RSpec doesn’t report backtraces of pending examples so
this never came up.

Please report this to http://rspec.lighthouseapp.com

Cheers,
David

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs