mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
fix formatting issues
This commit is contained in:
parent
17ed0829b4
commit
2db12d99f5
3 changed files with 10 additions and 16 deletions
|
@ -4,14 +4,14 @@ require "base64"
|
||||||
class SimpleMapping
|
class SimpleMapping
|
||||||
DB.mapping({
|
DB.mapping({
|
||||||
c0: Int32,
|
c0: Int32,
|
||||||
c1: String
|
c1: String,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
class NonStrictMapping
|
class NonStrictMapping
|
||||||
DB.mapping({
|
DB.mapping({
|
||||||
c1: Int32,
|
c1: Int32,
|
||||||
c2: String
|
c2: String,
|
||||||
}, strict: false)
|
}, strict: false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ class MappingWithKeys
|
||||||
end
|
end
|
||||||
|
|
||||||
class MappingWithConverter
|
class MappingWithConverter
|
||||||
|
|
||||||
module Base64Converter
|
module Base64Converter
|
||||||
def self.from_rs(rs)
|
def self.from_rs(rs)
|
||||||
Base64.decode(rs.read(String))
|
Base64.decode(rs.read(String))
|
||||||
|
@ -69,7 +68,6 @@ macro expect_mapping(query, t, values)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "DB.mapping" do
|
describe "DB.mapping" do
|
||||||
|
|
||||||
it "should initialize a simple mapping" do
|
it "should initialize a simple mapping" do
|
||||||
expect_mapping("1,a", SimpleMapping, {c0: 1, c1: "a"})
|
expect_mapping("1,a", SimpleMapping, {c0: 1, c1: "a"})
|
||||||
end
|
end
|
||||||
|
@ -149,5 +147,4 @@ describe "DB.mapping" do
|
||||||
objs[1].c1.should eq("b")
|
objs[1].c1.should eq("b")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
module DB
|
module DB
|
||||||
|
|
||||||
class Error < Exception
|
class Error < Exception
|
||||||
end
|
end
|
||||||
|
|
||||||
class MappingException < Exception
|
class MappingException < Exception
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
module DB
|
module DB
|
||||||
|
|
||||||
# Empty module used for marking a class as supporting DB:Mapping
|
# Empty module used for marking a class as supporting DB:Mapping
|
||||||
module Mappable; end
|
module Mappable; end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue