Sha256: 29d5c9219b3e6f220de9ec27d32b497b1236c1c3f150aa41b7ba15649a9c5d02

Contents?: true

Size: 462 Bytes

Versions: 3

Compression:

Stored size: 462 Bytes

Contents

describe "subclassing" do
  subject do
    class Test::Foo
      extend Dry::Initializer::Mixin

      param  :foo
      option :bar
    end

    class Test::Bar < Test::Foo
      param  :baz
      option :qux
    end

    Test::Bar.new 1, 2, bar: 3, qux: 4
  end

  it "preserves definitions made in the superclass" do
    expect(subject.foo).to eql 1
    expect(subject.baz).to eql 2
    expect(subject.bar).to eql 3
    expect(subject.qux).to eql 4
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dry-initializer-0.2.0 spec/dry/subclassing_spec.rb
dry-initializer-0.1.1 spec/dry/subclassing_spec.rb
dry-initializer-0.1.0 spec/dry/subclassing_spec.rb