Skip to content

Idea: load spec/support files on replay for global shared examples #3

@mnmandahalf

Description

@mnmandahalf

Thank you for creating such a fantastic gem.

I noticed that RSpec.configuration doesn't retain global shared examples because they are private members, and as such, they're not accessible.
To resolve this, I attempted to add the following code to re-register global shared examples in Rspec.world, which seemed to work well:

$LOAD_PATH << "./spec/support"
Dir["./spec/support/**/*.rb"].sort.each { |f| load f }

However, this piece of code seems to slow down the spec execution as it loads all files.
Do you think this approach is a good trade-off for the utility it provides?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions