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