Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add spec for Virtus::ValueObject.attribute

  • Loading branch information...
commit 9cc4918b0ae3cd38c2b22a061132a634002ff0e9 1 parent 721d578
@solnic authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 spec/unit/virtus/value_object/class_methods/attribute_spec.rb
View
13 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
+
Please sign in to comment.
Something went wrong with that request. Please try again.