diff options
author | Vladimir Kochnev <hashtable@yandex.ru> | 2015-08-28 19:12:56 +0300 |
---|---|---|
committer | Vladimir Kochnev <hashtable@yandex.ru> | 2015-08-31 12:21:36 +0300 |
commit | 488c423c8978a2dbaa69d45338e8660e45c5c169 (patch) | |
tree | 1a060eb611c89bdcd04f02c06aaaffc839cc30f4 /spec/hashie/extensions | |
parent | edeef5633c9b5efb288bc5ad4530b286470a9196 (diff) | |
download | hashie-488c423c8978a2dbaa69d45338e8660e45c5c169.tar.gz |
Introduce Hashie::Extensions::Dash::Coercion.
Diffstat (limited to 'spec/hashie/extensions')
-rw-r--r-- | spec/hashie/extensions/dash/coercion_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/hashie/extensions/dash/coercion_spec.rb b/spec/hashie/extensions/dash/coercion_spec.rb new file mode 100644 index 0000000..ce1f14a --- /dev/null +++ b/spec/hashie/extensions/dash/coercion_spec.rb @@ -0,0 +1,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 |