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

Version Path
sinclair-2.1.1 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-2.1.0 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-2.0.1 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-2.0.0 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-1.16.3 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-1.16.2 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-1.16.1 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-1.16.0 spec/integration/yard/sinclair/caster/caster_for_spec.rb
sinclair-1.15.0 spec/integration/yard/sinclair/caster/caster_for_spec.rb