File: coercion_spec.rb

package info (click to toggle)
ruby-hashie 5.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 884 kB
  • sloc: ruby: 7,049; sh: 8; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 328 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'spec_helper'

describe Hashie::Extensions::Dash::Coercion do
  class DashWithCoercion < Hashie::Dash
    include Hashie::Extensions::Dash::Coercion

    property :type, coerce: Symbol
  end

  it 'does the coercion of properties' do
    expect(DashWithCoercion.new(type: 'something')).to eq(type: :something)
  end
end