avro_turf 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdd8c25f6656ec55bcb0054fa42e4a85d5018fa6
4
- data.tar.gz: af4d189168531a28fc31793f8f3c65146c70e976
3
+ metadata.gz: 2e286ef91f22f8b2d66e7d91a7fb7eefef94911c
4
+ data.tar.gz: 774a729aaa90259a828a5c1080711fa9b95003b1
5
5
  SHA512:
6
- metadata.gz: 039e85f46a0d25766bc24dabe3984e4f1fc6b4c535aaacf53a87d8db8ee308693c5c210eb7c550bcf752de2ab3048cbed06a4bb003e23123b0ea8dfb37c0e648
7
- data.tar.gz: d40406ac87ac25fd476b82c14a8f732daf9067d26176aa2138d234264a8bb8c543ed3d55623161c4adb9320311296485297bb93a96459ac240739ceaa659df3f
6
+ metadata.gz: ee5f9aaa4bf4df9025818a6de776e673386f8de7a64f5bfa8487e32bf276775a7e2c97f59e0791426b10cea27d0b7ab49a67973bd89fcf46924f989547d17191
7
+ data.tar.gz: f1ad05167aa4c72cc727d7d2788240fa19a69144a6c09bb67e4cbb8b08e97319eeb5341172ba9ca28b980dfcfa5d3b6d34c027c5a8f4c411e326c0b185980621
@@ -1,3 +1,3 @@
1
1
  class AvroTurf
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
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`.
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avro_turf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Schierbeck