Permalink
Browse files

Add spec for Virtus::ValueObject.attribute

  • Loading branch information...
1 parent 721d578 commit 9cc4918b0ae3cd38c2b22a061132a634002ff0e9 @solnic committed Mar 19, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 spec/unit/virtus/value_object/class_methods/attribute_spec.rb
@@ -1,5 +1,16 @@
require 'spec_helper'
describe Virtus::ValueObject, '.attribute' do
- it 'should have spec'
+ subject { model.attributes[name] }
+
+ let(:model) { Class.new { include Virtus::ValueObject } }
+ let(:name) { :lat }
+ let(:type) { Float }
+
+ before { model.attribute(name, type) }
+
+ it { should be_instance_of(Virtus::Attribute::Float) }
+
+ specify { subject.options[:writer].should be(:private) }
end
+

0 comments on commit 9cc4918

Please sign in to comment.