Sha256: 48b3875d6a93a601a7a3e3ae063d60a03bf4343c64035cd152c59205dd388bc1

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

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

      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

1 entries across 1 versions & 1 rubygems

Version Path
dry-initializer-0.0.1 spec/dry/dry_type_spec.rb