Sha256: 619bd8a9031a3a5ce3fe2d22f1c6f45e1bfdbfc561ce5d6f059d35cbd262dd46

Contents?: true

Size: 382 Bytes

Versions: 18

Compression:

Stored size: 382 Bytes

Contents

require 'test_helper'

class Superstore::Types::FloatTypeTest < Superstore::Types::TestCase
  test 'encode' do
    assert_equal '5.01', coder.encode(5.01)

    assert_raise ArgumentError do
      coder.encode('x')
    end
  end

  test 'decode' do
    assert_equal 0.0, coder.decode('xyz')
    assert_equal 3.14, coder.decode('3.14')
    assert_equal 5, coder.decode('5')
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
superstore-1.2.0 test/unit/types/float_type_test.rb
superstore-1.1.4 test/unit/types/float_type_test.rb
superstore-1.1.3 test/unit/types/float_type_test.rb
superstore-1.1.2 test/unit/types/float_type_test.rb
superstore-1.1.1 test/unit/types/float_type_test.rb
superstore-1.1.0 test/unit/types/float_type_test.rb
superstore-1.0.12 test/unit/types/float_type_test.rb
superstore-1.0.11 test/unit/types/float_type_test.rb
superstore-1.0.10 test/unit/types/float_type_test.rb
superstore-1.0.9 test/unit/types/float_type_test.rb
superstore-1.0.8 test/unit/types/float_type_test.rb
superstore-1.0.7 test/unit/types/float_type_test.rb
superstore-1.0.6 test/unit/types/float_type_test.rb
superstore-1.0.5 test/unit/types/float_type_test.rb
superstore-1.0.4 test/unit/types/float_type_test.rb
superstore-1.0.3 test/unit/types/float_type_test.rb
superstore-1.0.2 test/unit/types/float_type_test.rb
superstore-1.0.0 test/unit/types/float_type_test.rb