# frozen_string_literal: true RSpec.shared_examples_for 'Dry::Types::Nominal without primitive' do def be_boolean satisfy { |x| x == true || x == false } end describe '#constrained?' do it 'returns a boolean value' do expect(type.constrained?).to be_boolean end end describe '#default?' do it 'returns a boolean value' do expect(type.default?).to be_boolean end end describe '#valid?' do it 'returns a boolean value' do expect(type.valid?(1)).to be_boolean end end describe '#eql?' do it 'has #eql? defined' do expect(type).to eql(type) end end describe '#==' do it 'has #== defined' do expect(type).to eq(type) end end describe '#optional?' do it 'returns a boolean value' do expect(type.optional?).to be_boolean end end describe '#to_s' do it 'returns a custom string representation' do expect(type.to_s).to start_with('#