Sha256: 92af4d5136e73ae0c480cbf1921c630305c60c8edde4037810dd83a9cd0af4de

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents

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

      param :foo, type: Dry::Types::Coercible::String
    end
  end

  pending context "in case of mismatch" do
    subject { Test::Foo.new :foo }

    it "raises TypeError" do
      expect { subject }.to raise_error TypeError, /:foo/
    end
  end

  pending context "in case of match" do
    subject { Test::Foo.new "foo" }

    it "completes the initialization" do
      expect { subject }.not_to raise_error
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-initializer-0.1.1 spec/dry/dry_type_spec.rb
dry-initializer-0.1.0 spec/dry/dry_type_spec.rb