Sha256: 05077b524ef1a94cf989535333770d4cb973914ca2477d65e1b70df7dc6377ee

Contents?: true

Size: 485 Bytes

Versions: 10

Compression:

Stored size: 485 Bytes

Contents

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

      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

10 entries across 10 versions & 1 rubygems

Version Path
dry-initializer-0.5.0 spec/dry/reader_spec.rb
dry-initializer-0.4.0 spec/dry/reader_spec.rb
dry-initializer-0.3.3 spec/dry/reader_spec.rb
dry-initializer-0.3.2 spec/dry/reader_spec.rb
dry-initializer-0.3.1 spec/dry/reader_spec.rb
dry-initializer-0.3.0 spec/dry/reader_spec.rb
dry-initializer-0.2.1 spec/dry/reader_spec.rb
dry-initializer-0.2.0 spec/dry/reader_spec.rb
dry-initializer-0.1.1 spec/dry/reader_spec.rb
dry-initializer-0.1.0 spec/dry/reader_spec.rb