Sha256: 7b92910b21c6fc9e74a62376b3b8809ce82b54a4862c99d4f307c329c224b2df

Contents?: true

Size: 1.93 KB

Versions: 1

Compression:

Stored size: 1.93 KB

Contents

#see: https://github.com/dry-rb/dry-validation/issues/127

RSpec.describe 'Predicates: Key' do
  context 'with required' do
    xit "should raise error" do
      expect { Dry::Validation.Form do
        required(:foo) { key? }
      end }.to raise_error InvalidSchemaError
    end
  end

  context 'with optional' do
    subject(:schema) do
      xit "should raise error" do
        expect { Dry::Validation.Form do
          optional(:foo) { key? }
        end }.to raise_error InvalidSchemaError
      end
    end
  end

  context 'as macro' do
    context 'with required' do
      context 'with value' do
        xit "should raise error" do
          expect { Dry::Validation.Form do
            required(:foo).value(:key?)
          end }.to raise_error InvalidSchemaError
        end
      end

      context 'with filled' do
        xit "should raise error" do
          expect { Dry::Validation.Form do
            required(:foo).filled(:key?)
          end }.to raise_error InvalidSchemaError
        end
      end

      context 'with maybe' do
        xit "should raise error" do
          expect { Dry::Validation.Form do
            required(:foo).maybe(:key?)
          end }.to raise_error InvalidSchemaError
        end
      end
    end

    context 'with optional' do
      context 'with value' do
        xit "should raise error" do
          expect { Dry::Validation.Schema do
            optional(:foo).value(:key?)
          end }.to raise_error InvalidSchemaError
        end
      end

      context 'with filled' do
        xit "should raise error" do
          expect { Dry::Validation.Schema do
            optional(:foo).filled(:key?)
          end }.to raise_error InvalidSchemaError
        end
      end

      context 'with maybe' do
        xit "should raise error" do
          expect { Dry::Validation.Schema do
            optional(:foo).maybe(:key?)
          end }.to raise_error InvalidSchemaError
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dry-validation-0.8.0 spec/integration/form/predicates/key_spec.rb