Permalink
Browse files

Add spec for Virtus::Attribute::Collection::MemberCoercion#coerce_and…

…_append_member
  • Loading branch information...
1 parent 7e9332b commit aaa9156ca9e169c2d65ba7766ff2ab2e0c7d4480 @solnic committed Mar 14, 2012
@@ -1,5 +1,18 @@
require 'spec_helper'
describe Virtus::Attribute::Collection::MemberCoercion, '#coerce_and_append_member' do
- it 'should have spec'
+ subject { object.coerce_and_append_member(collection, entry) }
+
+ let(:attribute_class) do
+ Class.new(Virtus::Attribute::Collection) do
+ include Virtus::Attribute::Collection::MemberCoercion
+ self
+ end
+ end
+
+ let(:object) { attribute_class.new('stuff', :member_type => Integer) }
+ let(:collection) { [] }
+ let(:entry) { '1' }
+
+ it { should eql([ 1 ]) }
end

0 comments on commit aaa9156

Please sign in to comment.