Sha256: 1dbf1dcfb1454d0931dc9399e12b935f4631de6a0e2994778b55510b28621795

Contents?: true

Size: 325 Bytes

Versions: 30

Compression:

Stored size: 325 Bytes

Contents

require 'spec_helper'

describe RestModel::Serialization::Float do
  it "converts to float" do
    subject.class.serialize('1200.49').should == 1200.49
  end

  context "when an invalid value is serialized" do
    it "raises an error" do
      expect {subject.class.serialize("not a float")}.to raise_error
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rest_model-0.3.1 spec/unit/serialization/float_spec.rb
rest_model-0.3.0 spec/unit/serialization/float_spec.rb
rest_model-0.2.3 spec/unit/serialization/float_spec.rb
rest_model-0.2.1 spec/unit/serialization/float_spec.rb
rest_model-0.2.0 spec/unit/serialization/float_spec.rb
rest_model-0.1.24 spec/unit/serialization/float_spec.rb
rest_model-0.1.23 spec/unit/serialization/float_spec.rb
rest_model-0.1.22 spec/unit/serialization/float_spec.rb
rest_model-0.1.21 spec/unit/serialization/float_spec.rb
rest_model-0.1.20 spec/unit/serialization/float_spec.rb
rest_model-0.1.19 spec/unit/serialization/float_spec.rb
rest_model-0.1.18 spec/unit/serialization/float_spec.rb
rest_model-0.1.17 spec/unit/serialization/float_spec.rb
rest_model-0.1.16 spec/unit/serialization/float_spec.rb
rest_model-0.1.15 spec/unit/serialization/float_spec.rb
rest_model-0.1.14 spec/unit/serialization/float_spec.rb
rest_model-0.1.13 spec/unit/serialization/float_spec.rb
rest_model-0.1.12 spec/unit/serialization/float_spec.rb
rest_model-0.1.11 spec/unit/serialization/float_spec.rb
rest_model-0.1.10 spec/unit/serialization/float_spec.rb