spec/unit/pr/fields/float_field_spec.rb in pr-0.0.1 vs spec/unit/pr/fields/float_field_spec.rb in pr-0.0.2
- old
+ new
@@ -1,15 +1,23 @@
require 'pr/fields/invalid_value'
require 'pr/fields/float_field'
describe 'a float field' do
- let(:klass) { PR::Fields::FloatField }
- let(:value) { double "value" }
- let(:field) { klass.new value }
+ let(:klass) { PR::Fields::FloatField }
+ let(:value) { double "value" }
+ let(:options) { Hash.new }
+ let(:field) { klass.new value, options }
describe "default value" do
- subject { klass.new }
- its(:raw) { should == '' }
+ subject { klass.new }
+ its(:raw) { should == '' }
+ 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 raw value' do
expect(field.raw).to eq value