Currently when a failure is reported it looks like this:
C:\dev\ruby\faster_rubygems\spec>spec
spec.faster_rubygems_cacheing.rb
F
1)
RuntimeError in 'FasterRubyGems cacheing Gem.bin_path should cache and
reload Gem.bin_path where possible'
assertion failed
C:/dev/ruby/faster_rubygems/spec/spec.faster_rubygems_cacheing.rb:
14:in `block (3 levels) in <top (required)>'
This is good because it tells me what line failed, but that's about
it.
The skinny of this request is that I'd find it more useful to actually
have the code displayed that failed on line 14, in this case, the word
"fail"
so like this:
C:/dev/ruby/faster_rubygems/spec/spec.faster_rubygems_cacheing.rb:14:
"fail"
Instead of the current
C:/dev/ruby/faster_rubygems/spec/spec.faster_rubygems_cacheing.rb:
14:in `block (3 levels) in <top (required)>'
So the failure report is good, but could be improved.
Another option would be to display the line below what is currently
output, like
C:/dev/ruby/faster_rubygems/spec/spec.faster_rubygems_cacheing.rb:
14:in `block (3 levels) in <top (required)>'
fail
Or something like that.
Any thoughts there?
Thanks.
-rp
_______________________________________________
rspec-users mailing list
rspec...@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Already done in rspec-2. Likely won't backport it to rspec-1 for some time (if ever).
Cheers,
David
Nice. Looks like rspec-2 will fit the bill for me for now, then.
1) Gem speeding Gem.bin_path the fake sick way should fake guess the
right path instead of loading full rubygems for now
Failure/Error: Unable to find matching line from backtrace
# spec.faster_rubygems.rb:29
# spec.faster_rubygems.rb:13
Perhaps it isn't quite windows friendly?
Thanks.
-rp
>>> The skinny of this request is that I'd find it more useful to actually
>>> have the code displayed that failed on line 14, in this case, the word
>>> "fail"
> ...
>> Already done in rspec-2. Likely won't backport it to rspec-1 for some time (if ever).
>
> Nice. Looks like rspec-2 will fit the bill for me for now, then.
>
> 1) Gem speeding Gem.bin_path the fake sick way should fake guess the
> right path instead of loading full rubygems for now
> Failure/Error: Unable to find matching line from backtrace
> # spec.faster_rubygems.rb:29
> # spec.faster_rubygems.rb:13
>
> Perhaps it isn't quite windows friendly?
That happens now and then when the error is in code generated with eval(string) with no file and ref numbers. Has nothing to do with Windows as far as I know, and is the same problem we have with ruby-debug.
HTH,
David
> > Perhaps it isn't quite windows friendly?
>
> That happens now and then when the error is in code generated with eval(string) with no file and ref numbers. Has nothing to do with Windows as far as I know, and is the same problem we have with ruby-debug.
Interesting.
I get the same thing with Linux.
If I add the word "fail" to an rspec, it says the same (not an eval
string...)...
Here's the output if I run it -b
1) Gem speeding Gem.bin_path the fake sick way should fake guess the
right path instead of loading full rubygems for now
Failure/Error: Unable to find matching line from backtrace
# spec.faster_rubygems.rb:29:in `block (3 levels) in <main>'
# /home/rdp/installs/ruby-1.9.1-p376_installed/lib/ruby/gems/1.9.1/
gems/rspec-core-2.0.0.beta.12/lib/rspec/core/example.rb:47:in
`instance_eval'
Hmm.
-r
>>> Failure/Error: Unable to find matching line from backtrace
>
>>> Perhaps it isn't quite windows friendly?
>>
>> That happens now and then when the error is in code generated with eval(string) with no file and ref numbers. Has nothing to do with Windows as far as I know, and is the same problem we have with ruby-debug.
>
> Interesting.
> I get the same thing with Linux.
> If I add the word "fail" to an rspec, it says the same (not an eval
> string...)...
>
> Here's the output if I run it -b
>
> 1) Gem speeding Gem.bin_path the fake sick way should fake guess the
> right path instead of loading full rubygems for now
> Failure/Error: Unable to find matching line from backtrace
> # spec.faster_rubygems.rb:29:in `block (3 levels) in <main>'
> # /home/rdp/installs/ruby-1.9.1-p376_installed/lib/ruby/gems/1.9.1/
> gems/rspec-core-2.0.0.beta.12/lib/rspec/core/example.rb:47:in
> `instance_eval'
Please file an issue at http://github.com/rspec/rspec-core/issues
Feel free to reference the method that handles this:
http://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/base_formatter.rb#L118
Thanks