spec/unit/pr/fields/generic_field_spec.rb in pr-0.0.1 vs spec/unit/pr/fields/generic_field_spec.rb in pr-0.0.2

- old
+ new

@@ -1,16 +1,24 @@ require 'pr/fields/generic_field' describe 'a generic field' do - let(:klass) { PR::Fields::GenericField } - let(:value) { double "value" } - let(:field) { klass.new value } + let(:klass) { PR::Fields::GenericField } + let(:value) { double "value" } + let(:options) { Hash.new } + let(:field) { klass.new value, options } describe "default value" do subject { klass.new } its(:raw) { should == nil } its(:convert) { should == nil } + its(:options) { should == {} } + end + + describe '#options' do + it 'has retrievable options' do + expect(field.options).to eq options + end end describe :raw do it "should return the value the field was initialized with" do field.raw.should == value