Skip to content
Browse files

Add an example to Virtus::Attribute::Collection#member_type spec

  • Loading branch information...
1 parent dd86c99 commit df79b605b49a3a6b6282f0b66a38c12d9187101c @solnic committed
Showing with 10 additions and 2 deletions.
  1. +10 −2 spec/unit/virtus/attribute/collection/member_type_spec.rb
View
12 spec/unit/virtus/attribute/collection/member_type_spec.rb
@@ -3,7 +3,15 @@
describe Virtus::Attribute::Collection, '#member_type' do
subject { object.member_type }
- let(:object) { Virtus::Attribute::Set.new('stuff', :member_type => Integer) }
+ context 'when specified' do
+ let(:object) { Virtus::Attribute::Set.new('stuff', :member_type => Integer) }
- it { should be(Integer) }
+ it { should be(Integer) }
+ end
+
+ context 'when not specified' do
+ let(:object) { Virtus::Attribute::Set.new('stuff') }
+
+ it { should be(Virtus::Attribute::Object) }
+ end
end

0 comments on commit df79b60

Please sign in to comment.
Something went wrong with that request. Please try again.