Sha256: 6e425094611bed77f29d0645b67b71753218ff65c4c6975438845ae9b250a04a

Contents?: true

Size: 455 Bytes

Versions: 1

Compression:

Stored size: 455 Bytes

Contents

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

      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

1 entries across 1 versions & 1 rubygems

Version Path
dry-initializer-0.0.1 spec/dry/subclassing_spec.rb