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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using :example_group from metadata is deprecated warning [Rspec] #8

Closed
etagwerker opened this issue Jan 25, 2016 · 6 comments 路 Fixed by #9
Closed

Using :example_group from metadata is deprecated warning [Rspec] #8

etagwerker opened this issue Jan 25, 2016 · 6 comments 路 Fixed by #9

Comments

@etagwerker
Copy link
Contributor

Hey @ghempton!

Thank you for developing this gem! It's been very useful so far. 馃憤

The only issue that I've found is that it shows this warning:

Deprecation Warnings:

The `:example_group` key in an example group's metadata hash is deprecated. Use the example group's hash directly for the computed keys and `:parent_example_group` to access the parent example group metadata instead. Called from /Users/etagwerker/.rvm/gems/ruby-2.2.1@sender/gems/camcorder-0.0.4/lib/camcorder/rspec.rb:9:in `yield'.


If you need more of the backtrace for any of these deprecations to
identify where to make the necessary changes, you can configure
`config.raise_errors_for_deprecations!`, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

1 deprecation warning total

This happens because Rspec has deprecated the usage of metadata[:example_group] - See: rspec/rspec-rails#1035

I tried to write a PR to fix this but I couldn't find a decent way to keep the current tree structure for the recordings.

Instead of using the recursive code that generates the nested folder, I could write an implementation that uses metadata[:full_description] to generate the recording file. The problem with this solution is that it wouldn't be backwards compatible. :(

What do you think?

Thanks!

@ghempton
Copy link
Owner

Thanks for looking into this. I would suggest looking at vcr's implementation of this (on which this recursive code was originally based). I bet they have found the right way around it.

@etagwerker
Copy link
Contributor Author

@ghempton Done! Vcr's current implementation doesn't generate this warning. Here is the PR ^

@blainejohnson17
Copy link

@ghempton, can you cut a new version on ruby gems which includes this change?

@ghempton
Copy link
Owner

Sure

@ghempton
Copy link
Owner

Just pushed 0.0.5

@blainejohnson17
Copy link

Thanks !

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 a pull request may close this issue.

3 participants