Sha256: d991ade918c5ecf75564b7bfd56413d7ed5028d9ccdad3e1145a8d265ee7db08

Contents?: true

Size: 445 Bytes

Versions: 18

Compression:

Stored size: 445 Bytes

Contents

require 'test_helper'

class Superstore::Types::IntegerTypeTest < Superstore::Types::TestCase
  test 'encode' do
    assert_equal '3', coder.encode(3)
    assert_equal '-3', coder.encode(-3)

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

  test 'decode' do
    assert_nil coder.decode('')
    assert_equal 0, coder.decode('abc')
    assert_equal 3, coder.decode('3')
    assert_equal -3, coder.decode('-3')
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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