Sha256: d333444f6204780bfc29e8278f380f0370326eaa0945511081bd17596fabb060
Contents?: true
Size: 548 Bytes
Versions: 9
Compression:
Stored size: 548 Bytes
Contents
# frozen_string_literal: false require 'spec_helper' describe 'yard Sinclair::Caster.cast' do it 'Getting the caster with symbol key' do expect(EnumConverter.to_array({ key: :value })).to eq([%i[key value]]) expect(EnumConverter.to_hash([%i[key value]])).to eq({ key: :value }) end it 'Getting the caster with class key' do expect(StringParser.cast('{"key":"value"}', JSON)).to eq({ 'key' => 'value' }) expect(StringParser.cast('10.2', Integer)).to eq(10) expect(StringParser.cast('10.2', Float)).to eq(10.2) end end
Version data entries
9 entries across 9 versions & 1 rubygems