Sha256: 3a52501f841de4c9cf3c8fe0559401dfc40ecbd613e097e2e67651e1003fd84f

Contents?: true

Size: 601 Bytes

Versions: 79

Compression:

Stored size: 601 Bytes

Contents

require 'test_helper'

class CassandraObject::Types::BooleanTypeTest < CassandraObject::Types::TestCase
  test 'encode' do
    assert_equal '1', coder.encode(true)
    assert_equal '1', coder.encode('true')
    assert_equal '1', coder.encode('1')

    assert_equal '0', coder.encode(false)
    assert_equal '0', coder.encode('false')
    assert_equal '0', coder.encode('0')
    assert_equal '0', coder.encode('')

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

  test 'decode' do
    assert_equal true, coder.decode('1')
    assert_equal false, coder.decode('0')
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
gotime-cassandra_object-4.8.1 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.8.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.7.3 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.7.2 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.7.1 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.7.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.6.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.5.1 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.5.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.4.5 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.4.4 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.4.3 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.4.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.3.2 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.3.1 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.3.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.2.2 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.2.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.1.0 test/unit/types/boolean_type_test.rb
gotime-cassandra_object-4.0.2 test/unit/types/boolean_type_test.rb