Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#backtrace_clean_patterns is deprecated #37

Closed
wants to merge 3 commits into from
Closed

#backtrace_clean_patterns is deprecated #37

wants to merge 3 commits into from

Conversation

Ephasme
Copy link
Contributor

@Ephasme Ephasme commented Jul 17, 2013

Compatibility with rspec-core 2.14.0
Replaced backtrace_clean_patterns by backtrace_exclusion_patterns

Compatibility with rspec-core 2.14.0
Replaced backtrace_clean_patterns by backtrace_exclusion_patterns
@mcmire
Copy link
Contributor

mcmire commented Jul 17, 2013

Thanks, but as mentioned in #36 I don't want to outright replace backtrace_clean_patterns with backtrace_exclusion_patterns because it'll make RR break on RSpec 2.13.0 (or maybe not that exactly, but versions before that). I'd rather have something like

patterns =
  if RSpec.configuration.respond_to?(:backtrace_exclusion_patterns)
    RSpec.configuration.backtrace_exclusion_patterns
  else 
    RSpec.configuration.backtrace_clean_patterns
  end

Can you make these changes instead?

@Ephasme
Copy link
Contributor Author

Ephasme commented Jul 17, 2013

For sure, I was forgetting backward compatibility.
Do you think I should update the Gemfile too ?

@mcmire
Copy link
Contributor

mcmire commented Jul 18, 2013

If you would like, yes. You'll want to update the appraisal gemfiles, though. There are references to rspec ~> 2.13 and also rspec-rails ~> 2.0 in the Appraisals file - update both to ~> 2.14 and then run rake appraisal:install - this willl update relevant lockfiles in gemfiles/ and also ensure that you have rspec 2.14 and rspec-rails 2.14.

@Ephasme
Copy link
Contributor Author

Ephasme commented Jul 18, 2013

I will do that this evening.

@janxious
Copy link

janxious commented Aug 6, 2013

Any chance of getting a new gem release with this in it?

@mcmire
Copy link
Contributor

mcmire commented Aug 7, 2013

Yes, I haven't forgotten. I'll have a new release soon.

@sanemat
Copy link

sanemat commented Aug 16, 2013

I wait a new release 😌

@mcmire
Copy link
Contributor

mcmire commented Aug 17, 2013

Thanks, merged.

@mcmire
Copy link
Contributor

mcmire commented Aug 18, 2013

Just released 1.1.2 with this change.

@janxious
Copy link

Excellent! Thanks!

@mcmire
Copy link
Contributor

mcmire commented Aug 18, 2013

Cool. I put this in the changelog but please note, if you are using

RSpec.configure do |c|
  c.mock_with :rr
end

you will still see a deprecation warning. This is coming from RSpec, not RR, specifically this line: https://github.com/rspec/rspec-core/blob/v2.14.5/lib/rspec/core/mocking/with_rr.rb#L3. This will be fixed in the next release of RSpec, so you can either wait until then, or drop mock_with :rr from your spec_helper.rb (it's basically a no-op as RR has already mixed itself into RSpec by that point).

@pablox-cl
Copy link

FWIW; using the latest stable rspec (2.14.7), I'm still seeing the deprecation warning. It looks like on master it's fixed already, but I guess we will have to wait a bit.

@pablox-cl
Copy link

Oh, I should add that removing the mock_with :rr, just results in deprecations about that I should use double instead of mock.

(I'm using Padrino 0.12.0)

pablox-cl pushed a commit to pablox-cl/padrino-framework that referenced this pull request Feb 14, 2014
This commit fixes the following error:

    DEPRECATION: RSpec::Core::Configuration#backtrace_clean_patterns is
    deprecated. Use RSpec::Core::Configuration#backtrace_exclusion_patterns
    instead.

...that appears when using rspec + rr. Since a while there's no need of
using the `conf.with_mock :rr` in Rspec conf. See more info [here][1].

[1]: rr/rr#37 (comment)
@mcmire
Copy link
Contributor

mcmire commented Feb 14, 2014

Okay, thanks. Out of curiosity what are the deprecations you're seeing from RSpec? Is there a backtrace associated?

@pablox-cl
Copy link

Oh, since somewhere along the road rspec changed from mock to double, not requiring rr nor loading with the previous deprecated mock_with :rr, results in rspec trying to use the their own deprecated mock. Is that what you were asking? Or I just misunderstood the question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants