On Jan 4, 8:51 am, Pito Salas <[email protected]> wrote:
> I am Running rspec 2.11.1. I am trying to control the excessive number of
> backtrace lines (and also trying to 'understand'). Do you see what's going
> on? Thanks!
>
> In troubleshooting, I've added these lines to my very simple spec:
>
> require 'spec_helper'
>
> > RSpec::configure do |c|
> >   c.backtrace_clean_patterns << /gems\//
> >   puts c.backtrace_clean_patterns
> > end
>
> > describe Participant do
> >   it { Participant.find(1).guid.should_not be_blank }
> > end
>
> I run specs like this:
>
> repsurv(authent)> rspec spec/models/
>
> My .rspec is:
>
> --format documentation
>
> The output of the puts is this (odd?)
>
> (?-mix:\/lib\d*\/ruby\/)
>
> > (?-mix:bin\/)
> > (?-mix:gems)
> > (?-mix:spec\/spec_helper\.rb)
> > (?-mix:lib\/rspec\/(core|expectations|matchers|mocks))
> > (?-mix:gems\/)
>
> Yet, I am seeing lots of lines like this:
>
>      #
>
>
>
>
>
>
>
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/example_group.rb:361:in
> > `run'
> >      #
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/command_line.rb:28:in
> > `block (2 levels) in run'
> >      #
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/command_line.rb:28:in
> > `map'
> >      #
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/command_line.rb:28:in
> > `block in run'
> >      #
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/reporter.rb:34:in
> > `report'
> >      #
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/command_line.rb:25:in
> > `run'
> >      #
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/runner.rb:69:in
> > `run'
> >      #
> > /Users/pitosalas/.rvm/gems/ruby-1.9.3-p194@repeatsurvey/gems/rspec-core-2.1 
> > 1.1/lib/rspec/core/runner.rb:8:in
> > `block in autorun'


Thanks for the clear level of detail.  I suspect that you have
something setting the `--backtrace` option, which causes the full
backtrace to be dumped (and thus your backtrace filters to be
skipped).  RSpec provides several ways to set options:

* .rspec in your project root -- for project settings
* ~/.rspec -- for your personal rspec preferences for all projects
* .rspec-local in your project root -- for a dev's specific
preferences for a project (meant to be git-ignored)
* The SPEC_OPTS env variable
* Any `RSpec.configure` blocks in code that is loaded at runtime

This provides a ton of flexibility (which is nice) but can also make
it tricky to hunt down why rspec's behaving a certain way (which can
be frustrating).  Anyhow, look through those and see if anything is
forcing the full backtrace.

BTW, you shouldn't need to add the `gems` entry to the filter
patterns.  As you're puts demonstrated, it's already in the default
patterns.

HTH,
Myron

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to