Sha256: 6956e829f2d9f98c6e73787ffa2115ed3715a5dc71016f1fb16d8f4c381a4a44

Contents?: true

Size: 563 Bytes

Versions: 6

Compression:

Stored size: 563 Bytes

Contents

require 'mida_vocabulary/datatype'

describe Mida::DataType::Number do

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

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

  it '#parse should accept a valid number' do
    num_text = '3.14'
    num = Mida::DataType::Number.parse(num_text)
    num.to_s.should == num_text
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mida_vocabulary-0.2.2 spec/datatype/number_spec.rb
mida_vocabulary-0.2 spec/datatype/number_spec.rb
mida_vocabulary-0.1.3 spec/datatype/number_spec.rb
mida_vocabulary-0.1.2 spec/datatype/number_spec.rb
mida_vocabulary-0.1.1 spec/datatype/number_spec.rb
mida_vocabulary-0.1 spec/datatype/number_spec.rb