Sha256: 78616145446365a670d2ce2d664e5860c16e721875c93c5852a12152e99bd91a

Contents?: true

Size: 769 Bytes

Versions: 4

Compression:

Stored size: 769 Bytes

Contents

require 'dry/system/auto_registrar/configuration'

RSpec.describe Dry::System::AutoRegistrar::Configuration do
  subject(:auto_registration_conf) { Dry::System::AutoRegistrar::Configuration.new }

  describe "deafult values" do
    it "will setup exclude default proc" do
      expect(subject.exclude.(8)).to eq false
    end

    it "will setup instance default proc" do
      component = double("component")
      expect(component).to receive(:instance)
      subject.instance.(component)
    end
  end

  describe "add custom proc object to configuration" do
    it "execute proc that was previously save" do
      proc = Proc.new { |value| value + 1 }
      subject.instance(&proc)
      result = subject.instance.(5)
      expect(result).to eq 6
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dry-system-0.7.3 spec/unit/auto_registrar/configuration_spec.rb
dry-system-0.7.2 spec/unit/auto_registrar/configuration_spec.rb
dry-system-0.7.1 spec/unit/auto_registrar/configuration_spec.rb
dry-system-0.7.0 spec/unit/auto_registrar/configuration_spec.rb