Sha256: e44cb3eea58790799b87b4ea3d50edfa87a2d6e0b1d78d7776988142d2f08366
Contents?: true
Size: 493 Bytes
Versions: 5
Compression:
Stored size: 493 Bytes
Contents
describe "object type constraint" do before do class Test::Foo extend Dry::Initializer::Mixin param :foo, type: /bar/ end end context "in case of mismatch" do subject { Test::Foo.new "baz" } it "raises TypeError" do expect { subject }.to raise_error TypeError end end context "in case of match" do subject { Test::Foo.new "barbar" } it "completes the initialization" do expect { subject }.not_to raise_error end end end
Version data entries
5 entries across 5 versions & 1 rubygems