Sha256: 293dcbc2a85999af944767f1a2607b781446834d88d56434ed17791d15088e9d

Contents?: true

Size: 564 Bytes

Versions: 8

Compression:

Stored size: 564 Bytes

Contents

require 'spec_helper'

describe Acfs::Resource::Attributes::Float do
  let(:model) { Class.new Acfs::Resource }
  subject { described_class.new }

  describe 'cast' do
    it 'should return same object, if obj is already of float class' do
      expect(subject.cast(1.3)).to be == 1.3
    end

    it 'should return parsed object, if obj is of Fixnum class' do
      expect(subject.cast(7)).to be == 7.0
    end

    it 'should return parsed object, if obj is of String class containing a float' do
      expect(subject.cast('1.7')).to be == 1.7
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
acfs-0.45.0 spec/acfs/resource/attributes/float_spec.rb
acfs-0.44.0 spec/acfs/resource/attributes/float_spec.rb
acfs-0.43.2 spec/acfs/resource/attributes/float_spec.rb
acfs-0.43.1 spec/acfs/resource/attributes/float_spec.rb
acfs-0.43.0 spec/acfs/resource/attributes/float_spec.rb
acfs-1.0.0.dev.1.b305 spec/acfs/resource/attributes/float_spec.rb
acfs-1.0.0.dev.1.b298 spec/acfs/resource/attributes/float_spec.rb
acfs-1.0.0.dev.1.b297 spec/acfs/resource/attributes/float_spec.rb