Sha256: 46b015662282b714b1dd4ddb7c365eedf1a3a30c91642c0558860a367669dbed

Contents?: true

Size: 558 Bytes

Versions: 5

Compression:

Stored size: 558 Bytes

Contents

require 'mida/datatype'

describe Mida::DataType::Float do

  it '#parse should raise an exception if not a number' do
    test = lambda {Mida::DataType::Float.parse('hello')}
    test.should raise_error(ArgumentError)
  end

  it '#parse should raise an exception if value is empty' do
    test = lambda {Mida::DataType::Float.parse('')}
    test.should raise_error(ArgumentError)
  end

  it '#parse should accept a valid number' do
    float_text = '3.14'
    float = Mida::DataType::Float.parse(float_text)
    float.to_s.should == float_text
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mida-0.3.9 spec/datatype/float_spec.rb
mida-0.3.8 spec/datatype/float_spec.rb
mida-0.3.7 spec/datatype/float_spec.rb
mida-0.3.6 spec/datatype/float_spec.rb
mida-0.3.3 spec/datatype/float_spec.rb