Sha256: 2f64d450c5e1e47b1c033be4b17a1cd41ffc8b309f5a8781001e083250d5e282

Contents?: true

Size: 322 Bytes

Versions: 26

Compression:

Stored size: 322 Bytes

Contents

describe "default nil" do
  before do
    class Test::Foo
      extend Dry::Initializer::Mixin

      param :foo, default: proc { nil }
      param :bar, default: proc { nil }
    end
  end

  it "is assigned" do
    subject = Test::Foo.new(1)

    expect(subject.foo).to eql 1
    expect(subject.bar).to be_nil
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
dry-initializer-0.3.1 spec/dry/default_nil_spec.rb
dry-initializer-0.3.0 spec/dry/default_nil_spec.rb
dry-initializer-0.2.1 spec/dry/default_nil_spec.rb
dry-initializer-0.2.0 spec/dry/default_nil_spec.rb
dry-initializer-0.1.1 spec/dry/default_nil_spec.rb
dry-initializer-0.1.0 spec/dry/default_nil_spec.rb