Sha256: 1e9cba752df7d79705df8e82be77f0c1c604324af3d06512cda993dfa349d2f5

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

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

      param  :foo, reader: false
      option :bar, reader: false
    end

    Test::Foo.new 1, bar: 2
  end

  it "skips attr_reader" do
    expect(subject).not_to respond_to :foo
    expect(subject).not_to respond_to :bar
  end

  it "keeps assigning variables" do
    expect(subject.instance_variable_get(:@foo)).to eql 1
    expect(subject.instance_variable_get(:@bar)).to eql 2
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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