Sha256: b109ed3621e3be97731963ceba4a95fdd1a618ebc63f4d7226d133994ffe3725
Contents?: true
Size: 693 Bytes
Versions: 13
Compression:
Stored size: 693 Bytes
Contents
require 'test_helper' class Superstore::Types::StringTypeTest < Superstore::Types::TestCase test 'encode' do assert_equal 'abc', type.encode('abc') assert_raise ArgumentError do type.encode(123) end end test 'encode as utf' do assert_equal( '123'.force_encoding('UTF-8').encoding, type.encode('123'.force_encoding('ASCII-8BIT')).encoding ) end test 'encode frozen as utf' do assert_equal( '123'.force_encoding('UTF-8').encoding, type.encode('123'.force_encoding('ASCII-8BIT').freeze).encoding ) end test 'typecast' do assert_equal '123', type.typecast(123) assert_equal '123', type.typecast('123') end end
Version data entries
13 entries across 13 versions & 1 rubygems