Sha256: 071fc7677b8700755b2790cb211f80311e65d1f2dbd17ac9ad214d1508367c76
Contents?: true
Size: 569 Bytes
Versions: 11
Compression:
Stored size: 569 Bytes
Contents
require 'spec_helper' include Restspec::Schema::Types describe OneOfType do let(:type) { OneOfType.new(elements: [1, 2, 3]) } describe '#example_for' do it 'returns one example of the elements array' do expect([1, 2, 3]).to include(type.example_for(double)) end end describe '#valid' do it 'checks if the value is one of the elements array' do expect(type.totally_valid?(double, 1)).to eq(true) expect(type.totally_valid?(double, nil)).to eq(false) expect(type.totally_valid?(double, '1')).to eq(false) end end end
Version data entries
11 entries across 11 versions & 1 rubygems