Sha256: f9ec9c6a3597538e516ddcac638b37194b4b510e89f88f37b9dabe8d488b1e75

Contents?: true

Size: 606 Bytes

Versions: 2

Compression:

Stored size: 606 Bytes

Contents

require "dry/container/stub"

RSpec.shared_context "with application container" do
  using Refinements::Structs

  include_context "with temporary directory"

  let(:container) { <%= configuration.project_namespaced_class %>::Container }
  let(:configuration) { <%= configuration.project_namespaced_class %>::Configuration::Loader.with_defaults.call }
  let(:kernel) { class_spy Kernel }

  before do
    container.enable_stubs!
    container.stub :configuration, configuration
    container.stub :kernel, kernel
  end

  after do
    container.unstub :configuration
    container.unstub :kernel
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gemsmith-17.0.1 lib/gemsmith/templates/%project_name%/spec/support/shared_contexts/application_container.rb.erb
gemsmith-17.0.0 lib/gemsmith/templates/%project_name%/spec/support/shared_contexts/application_container.rb.erb