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

The :example_group key... deprecation in every describe and context block #1035

Closed
Dkendal opened this issue May 21, 2014 · 5 comments
Closed

Comments

@Dkendal
Copy link

Dkendal commented May 21, 2014

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. 

I'm getting this error from every single describe and context block in my project, but I have no idea what it means. None of my describe blocks make any use of meta data.

rspec-rails 3.0.0.rc1 post 2.99 upgrade, on Rails 4.0.5.

@JonRowe
Copy link
Member

JonRowe commented May 21, 2014

Something is accessing your example group's metadata, and that behaviour is deprecated. Can you gist your Gemfile, are you using any plugins?

@myronmarston
Copy link
Member

Can you set config.raise_errors_for_deprecations! and paste the backtrace? You probably have a gem that is accessing the deprecated metadata key, and that'll tell us what is causing it.

@Dkendal
Copy link
Author

Dkendal commented May 21, 2014

It would appear that Draper::DecoratorExampleGroup is the cause:

From: .../vendor/bundle/gems/rspec-core-3.0.0.rc1/lib/rspec/core/configuration.rb @ line 1004 RSpec::Core::Configuration#configure_group:

    1002: def configure_group(group)
    1003:   include_or_extend_modules.each do |include_or_extend, mod, filters|
 => 1004:     next unless filters.empty? || group.any_apply?(filters)
    1005:     __send__("safe_#{include_or_extend}", mod, group)
    1006:   end
    1007: end

[19] pry(#<RSpec::Core::Configuration>)> mod
Draper::DecoratorExampleGroup
[20] pry(#<RSpec::Core::Configuration>)> filters
{
    :example_group => {
        :file_path => /spec\/decorators/
    },
             :type => :decorator
}

I'm going to submit a fix for draper for this - thanks for the quick responses though!

@Dkendal Dkendal closed this as completed May 21, 2014
@JonRowe
Copy link
Member

JonRowe commented May 21, 2014

👍

@myronmarston
Copy link
Member

Yep. It should use :file_path => /spec\/decorators/, :type => :decorator rather than :example_group => { :file_path => /spec\/decorators/ }, :type => :decorator.

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

No branches or pull requests

3 participants