avro_turf 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avro_turf/version.rb +1 -1
- data/lib/avro_turf.rb +1 -1
- data/spec/avro_turf_spec.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e286ef91f22f8b2d66e7d91a7fb7eefef94911c
|
4
|
+
data.tar.gz: 774a729aaa90259a828a5c1080711fa9b95003b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee5f9aaa4bf4df9025818a6de776e673386f8de7a64f5bfa8487e32bf276775a7e2c97f59e0791426b10cea27d0b7ab49a67973bd89fcf46924f989547d17191
|
7
|
+
data.tar.gz: f1ad05167aa4c72cc727d7d2788240fa19a69144a6c09bb67e4cbb8b08e97319eeb5341172ba9ca28b980dfcfa5d3b6d34c027c5a8f4c411e326c0b185980621
|
data/lib/avro_turf/version.rb
CHANGED
data/lib/avro_turf.rb
CHANGED
@@ -94,7 +94,7 @@ class AvroTurf
|
|
94
94
|
def valid?(data, schema_name: nil, namespace: @namespace)
|
95
95
|
schema = schema_name && @schema_store.find(schema_name, namespace)
|
96
96
|
|
97
|
-
Avro::Schema.validate(schema, data)
|
97
|
+
Avro::Schema.validate(schema, data.as_avro)
|
98
98
|
end
|
99
99
|
|
100
100
|
# Loads all schema definition files in the `schemas_dir`.
|
data/spec/avro_turf_spec.rb
CHANGED
@@ -142,5 +142,20 @@ describe AvroTurf do
|
|
142
142
|
datum = 42
|
143
143
|
expect(avro.valid?(datum, schema_name: "message")).to eq false
|
144
144
|
end
|
145
|
+
|
146
|
+
it "handles symbol keys in hashes" do
|
147
|
+
define_schema "postcard.avsc", <<-AVSC
|
148
|
+
{
|
149
|
+
"name": "postcard",
|
150
|
+
"type": "record",
|
151
|
+
"fields": [
|
152
|
+
{ "name": "message", "type": "string" }
|
153
|
+
]
|
154
|
+
}
|
155
|
+
AVSC
|
156
|
+
|
157
|
+
datum = { message: "hello" }
|
158
|
+
expect(avro.valid?(datum, schema_name: "postcard")).to eq true
|
159
|
+
end
|
145
160
|
end
|
146
161
|
end
|