summaryrefslogtreecommitdiff
path: root/spec/hashie/extensions
diff options
context:
space:
mode:
authorVladimir Kochnev <hashtable@yandex.ru>2015-08-28 19:12:56 +0300
committerVladimir Kochnev <hashtable@yandex.ru>2015-08-31 12:21:36 +0300
commit488c423c8978a2dbaa69d45338e8660e45c5c169 (patch)
tree1a060eb611c89bdcd04f02c06aaaffc839cc30f4 /spec/hashie/extensions
parentedeef5633c9b5efb288bc5ad4530b286470a9196 (diff)
downloadhashie-488c423c8978a2dbaa69d45338e8660e45c5c169.tar.gz
Introduce Hashie::Extensions::Dash::Coercion.
Diffstat (limited to 'spec/hashie/extensions')
-rw-r--r--spec/hashie/extensions/dash/coercion_spec.rb13
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