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

Fix documentation for nested described_class #2629

Merged

Conversation

pirj
Copy link
Member

@pirj pirj commented May 25, 2019

Fixes #2627

Documentation for described_class was out of date, a change was made in early 3.0 in #1361, but was not reflected to the docs.

Also, documentation for implicit subject was off, even though there is a feature describing how it behaves.

Fixes rspec#2627

Documentation for `described_class` was out of date, a change was made
in early 3.0 in rspec#1361, but was not reflected to the docs.

Also, documentation for implicit `subject` was off, even though there is
a feature describing how it behaves.
@pirj
Copy link
Member Author

pirj commented May 25, 2019

Any suggestion how to deal with Ruby 2.2 Rails 5.0 build failure in rspec-rails?

Gem::RuntimeRequirementNotMetError: i18n requires Ruby version >= 2.3.0. The current ruby version is 2.2.0.
An error occurred while installing i18n (1.6.0), and Bundler cannot continue.
...
In Gemfile:
  rails was resolved to 5.0.7.2, which depends on
    actioncable was resolved to 5.0.7.2, which depends on
      actionpack was resolved to 5.0.7.2, which depends on
        actionview was resolved to 5.0.7.2, which depends on
          rails-dom-testing was resolved to 2.0.3, which depends on
            activesupport was resolved to 5.0.7.2, which depends on
              i18n

It seems that Ruby dependency was bumped quite a while ago already.

Copy link
Member

@myronmarston myronmarston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Gonna merge since the build failure is clearly unrelated.

@myronmarston myronmarston merged commit d04d4de into rspec:master May 27, 2019
@pirj pirj deleted the fix-described_class-in-nested-examples-doc branch May 27, 2019 09:28
@pirj
Copy link
Member Author

pirj commented May 27, 2019

Awesome, thanks!

pirj added a commit to pirj/rubocop-rspec that referenced this pull request Jul 5, 2019
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
pirj added a commit to pirj/rubocop-rspec that referenced this pull request Jul 10, 2019
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
pirj added a commit to pirj/rubocop-rspec that referenced this pull request Jul 10, 2019
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
@pirj
Copy link
Member Author

pirj commented Aug 4, 2019

Is it possible to update 3-8-maintenance branch with this change? It's still outdated on Relish (1, 2) for both https://relishapp.com/rspec/rspec-core/docs/ and https://relishapp.com/rspec/rspec-core/v/3-8/docs paths.

@myronmarston
Copy link
Member

myronmarston commented Aug 8, 2019 via email

@JonRowe
Copy link
Member

JonRowe commented Aug 8, 2019

Thanks @myronmarston :)

kellysutton pushed a commit to kellysutton/rubocop-rspec that referenced this pull request Oct 28, 2019
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
…-examples-doc

Fix documentation for nested described_class
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 6, 2021
…ed_class-in-nested-examples-doc

Fix documentation for nested described_class

---
This commit was imported from rspec/rspec-core@d04d4de.
pirj added a commit to rubocop/rubocop-capybara that referenced this pull request Dec 29, 2022
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
ydah pushed a commit to rubocop/rubocop-factory_bot that referenced this pull request Apr 13, 2023
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
ydah pushed a commit to rubocop/rubocop-rspec_rails that referenced this pull request Mar 27, 2024
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
ydah pushed a commit to rubocop/rubocop-rspec_rails that referenced this pull request Mar 27, 2024
RSpec is actually setting the innermost described class as
`described_class`, not the top-level one:
rspec/rspec-core#2627
rspec/rspec-core#2629
https://github.com/rspec/rspec-core/blob/master/Changelog.md#300rc1--2014-05-18

> Breaking Changes for 3.0.0:
>   Change described_class so that in a nested group like describe
>   MyClass, it returns MyClass rather than the outer group's described
>   class.
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.

described_class is overridden in nested example group
3 participants