Sha256: 4c07f608228415e95bd16dd7080b4d926558a158b1c3cc5226a50e0a87a9f1c4

Contents?: true

Size: 359 Bytes

Versions: 8

Compression:

Stored size: 359 Bytes

Contents

describe "gem enhancement" do
  before do
    Dry::Initializer::Attribute.dispatchers << ->(string: false, **op) do
      op[:type] = proc(&:to_s) if string
      op
    end

    class Test::Foo
      extend Dry::Initializer
      param :bar, string: true
    end
  end

  it "works" do
    foo = Test::Foo.new(:BAZ)
    expect(foo.bar).to eq "BAZ"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-initializer-1.4.1 spec/gem_enhancement_spec.rb
dry-initializer-1.4.0 spec/gem_enhancement_spec.rb
dry-initializer-1.3.0 spec/gem_enhancement_spec.rb
dry-initializer-1.2.0 spec/enhancement_spec.rb
dry-initializer-1.1.3 spec/enhancement_spec.rb
dry-initializer-1.1.2 spec/enhancement_spec.rb
dry-initializer-1.1.1 spec/enhancement_spec.rb
dry-initializer-1.1.0 spec/enhancement_spec.rb