Sha256: 1b297c2e408d50038015085f0f651760d5037524a27e1c905241040d29da937e
Contents?: true
Size: 978 Bytes
Versions: 26
Compression:
Stored size: 978 Bytes
Contents
describe "container" do context "with block syntax" do before do class Test::Foo include Dry::Initializer.define { param :foo param :bar option :baz option :qux } end end it "instantiates attributes" do subject = Test::Foo.new(1, 2, baz: 3, qux: 4) expect(subject.foo).to eql 1 expect(subject.bar).to eql 2 expect(subject.baz).to eql 3 expect(subject.qux).to eql 4 end end context "with lambda syntax" do before do class Test::Foo include Dry::Initializer.define -> do param :foo param :bar option :baz option :qux end end end it "instantiates attributes" do subject = Test::Foo.new(1, 2, baz: 3, qux: 4) expect(subject.foo).to eql 1 expect(subject.bar).to eql 2 expect(subject.baz).to eql 3 expect(subject.qux).to eql 4 end end end
Version data entries
26 entries across 26 versions & 1 rubygems