# Loading providers for specs

**URL:** <https://discourse.hanakai.org/t/loading-providers-for-specs/1060>\
**Category:** questions\
**Created:** [November 18, 2024, 3:32am UTC](https://discourse.hanakai.org/t/loading-providers-for-specs/1060 "2024-11-18T03:32:13Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![alassek](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.hanakai.org/alassek/32/532_2.png) [@alassek](https://discourse.hanakai.org/u/alassek)\
**Post date:** [November 18, 2024, 4:58pm UTC](https://discourse.hanakai.org/t/loading-providers-for-specs/1060/3 "2024-11-18T16:58:53Z")

</div>

I just wrote something very similar:

```ruby
RSpec.configure do |config|
  config.before :each, :start do |example|
    example.metadata => { start: }

    containers = [Hanami.app.container] + Hanami.app.slices.each.map(&:container)

    Array(start).each do |provider_name|
      containers.each do |system|
        if system.providers.find_and_load_provider(provider_name)
          system.start(provider_name)
        end
      end
    end
  end
end

```

So it’s more general purpose, it would allow:

```ruby
RSpec.describe "myserializer", start: :serializers do

```

---

_[View the full topic](https://discourse.hanakai.org/t/loading-providers-for-specs/1060)._
