We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9714111 commit 2d2516aCopy full SHA for 2d2516a
spec/coercion_of_nil_spec.rb
@@ -0,0 +1,25 @@
1
+describe "coercion of nil" do
2
+ before do
3
+ class Test::Foo
4
+ extend Dry::Initializer
5
+ param :bar, proc(&:to_i)
6
+ end
7
+
8
+ class Test::Baz
9
+ include Dry::Initializer.define -> do
10
+ param :qux, proc(&:to_i)
11
12
13
14
15
+ let(:foo) { Test::Foo.new(nil) }
16
+ let(:baz) { Test::Baz.new(nil) }
17
18
+ it "works with extend syntax" do
19
+ expect(foo.bar).to eq 0
20
21
22
+ it "works with include syntax" do
23
+ expect(baz.qux).to eq 0
24
25
+end
0 commit comments