update Slice(UInt8) to Bytes

This commit is contained in:
Brian J. Cardiff 2016-06-22 14:13:44 -03:00
parent c8d5acceae
commit d65575cd77
3 changed files with 9 additions and 9 deletions

View file

@ -114,7 +114,7 @@ describe Driver do
it "executes and selects blob" do
with_db do |db|
slice = db.scalar(%(select X'53514C697465')).as(Slice(UInt8))
slice = db.scalar(%(select X'53514C697465')).as(Bytes)
slice.to_a.should eq([0x53, 0x51, 0x4C, 0x69, 0x74, 0x65])
end
end
@ -122,7 +122,7 @@ describe Driver do
it "executes with bind blob" do
with_db do |db|
ary = UInt8[0x53, 0x51, 0x4C, 0x69, 0x74, 0x65]
slice = db.scalar(%(select cast(? as BLOB)), Slice.new(ary.to_unsafe, ary.size)).as(Slice(UInt8))
slice = db.scalar(%(select cast(? as BLOB)), Bytes.new(ary.to_unsafe, ary.size)).as(Bytes)
slice.to_a.should eq(ary)
end
end
@ -161,7 +161,7 @@ describe Driver do
rs.column_type(0).should eq(String)
rs.column_type(1).should eq(Int64)
rs.column_type(2).should eq(Float64)
rs.column_type(3).should eq(Slice(UInt8))
rs.column_type(3).should eq(Bytes)
end
end
end
@ -193,9 +193,9 @@ describe Driver do
ary = UInt8[0x53, 0x51, 0x4C, 0x69, 0x74, 0x65]
db.exec "create table table1 (col1 blob)"
db.exec %(insert into table1 values (?)), Slice.new(ary.to_unsafe, ary.size)
db.exec %(insert into table1 values (?)), Bytes.new(ary.to_unsafe, ary.size)
slice = db.scalar("select cast(col1 as blob) from table1").as(Slice(UInt8))
slice = db.scalar("select cast(col1 as blob) from table1").as(Bytes)
slice.to_a.should eq(ary)
end
end