Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

:suite hooks should not support metadata #1741

Closed
@myronmarston

Description

@myronmarston

In #1725 there's discussion around a code snippet that includes this:

RSpec.configure do |config|
  config.before :suite, type: :feature do
    # ...
  end
end

The type: :feature metadata doesn't do anything (at least, it shouldn't) because it's nonsensical. Metadata applies to individual example groups and examples, not to the suite as a whole and before(:suite) hooks always get run. The fact that it is allowed here is an accident of implementation since other hook scopes allow metadata. We should explicitly disallow it in RSpec 4, and in RSpec 3 perhaps warn that it doesn't do anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions