cucumber-attic / cucumber-ruby-tcl

Tcl bindings for Cucumber
MIT License
9 stars 6 forks source link

Display line number where pending was called in backtrace #25

Open mattwynne opened 9 years ago

mattwynne commented 9 years ago

De-scoped from #22.

example:

     Scenario:
           Given pending
             TODO: Step not yet implemented (Cucumber::Core::Test::Result::Pending)
             features/step_definitions/steps.tcl:2
             features/test.feature:3:in `Given pending'

       1 scenario (1 pending)
       1 step (1 pending)
d-led commented 8 years ago

source locations in tcl are tricky. Here's my attempt. The frame level there will probably need some logic, as it's fine-tuned to the project set-up

mattwynne commented 8 years ago

@jowers can you take a look?

d-led commented 8 years ago

@jowers the updated version: in cucumber-tcl-wire that is more robust against frame level differences

jowers commented 8 years ago

Hi @d-led, thanks for the contribution on this.

I'll try to put together a test that we can try out - as you said, source locations can be tricky, and I'm finding that testing in a standlone file is returning locations one level out at the moment. Probably best to see how it behaves within the cucumber code before I go investiigating that though.

d-led commented 8 years ago

@jowers you're welcome! Here's the initial isolated investigation that lead to the code http://ideone.com/mdBT4s

upd: the only magic number left is the framelevel of get_location, which also could probably be robustly defined

d-led commented 8 years ago

the shortcomings can be seen here: http://ideone.com/K5zZva