Sha256: 0cdf50ec3641741428379c445a84eebbd563980e0c16c42968b6827833e261aa
Contents?: true
Size: 472 Bytes
Versions: 5
Compression:
Stored size: 472 Bytes
Contents
require 'spec_helper' describe Virtus::Coercion::String, '.to_float' do subject { described_class.to_float(string) } { '1' => 1.0, '1.0' => 1.0, '.1' => 0.1 }.each do |value, expected| context "with #{value.inspect}" do let(:string) { value } it { should be_instance_of(Float) } it { should eql(expected) } end end context 'with an invalid float string' do let(:string) { 'non-float' } it { should equal(string) } end end
Version data entries
5 entries across 5 versions & 1 rubygems