spec/unit/pr/fields/date_field_spec.rb in pr-0.0.1 vs spec/unit/pr/fields/date_field_spec.rb in pr-0.0.2
- old
+ new
@@ -1,17 +1,25 @@
require 'pr/fields/invalid_value'
require 'pr/fields/date_field'
describe 'a date field' do
- let(:klass) { PR::Fields::DateField }
- let(:value) { double "value" }
- let(:field) { klass.new value }
+ let(:klass) { PR::Fields::DateField }
+ let(:value) { double "value" }
+ let(:options) { Hash.new }
+ let(:field) { klass.new value, options }
describe "default value" do
subject { klass.new }
- its(:raw) { should == '' }
- specify { expect { subject.convert }.to raise_error PR::Fields::InvalidValue }
+ its(:raw) { should == '' }
+ specify { expect { subject.convert }.to raise_error PR::Fields::InvalidValue }
+ its(:options) { should == {} }
+ end
+
+ describe '#options' do
+ it 'has retrievable options' do
+ expect(field.options).to eq options
+ end
end
describe "raw" do
it "returns the value the field was initialized with" do
field.raw.should == value