Sha256: c957cb7a41e2c1b374d8357880992df56cbe95f06a2f4dddba7a1209cde2b73b
Contents?: true
Size: 730 Bytes
Versions: 13
Compression:
Stored size: 730 Bytes
Contents
require 'test_helper' class Superstore::Types::BooleanTypeTest < Superstore::Types::TestCase if Superstore::Base.adapter.class.name == 'Superstore::Adapters::CassandraAdapter' test 'encode' do assert_equal '1', type.encode(true) assert_equal '1', type.encode('true') assert_equal '1', type.encode('1') assert_equal '0', type.encode(false) assert_equal '0', type.encode('false') assert_equal '0', type.encode('0') assert_equal '0', type.encode('') assert_raise ArgumentError do type.encode('wtf') end end end test 'decode' do assert_equal true, type.decode('1') assert_equal false, type.decode('0') # assert_nil type.decode(nil) end end
Version data entries
13 entries across 13 versions & 1 rubygems