Skip to content

Commit

Permalink
Support Crystal 0.36.1
Browse files Browse the repository at this point in the history
  • Loading branch information
erdnaxeli committed Feb 6, 2021
1 parent d4f1e6b commit a8dce4a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: caridina
version: 0.8.0
version: 0.9.0

authors:
- Alexandre Morignot <[email protected]>

crystal: 0.35.0
crystal: 0.36.1

description: |
A Matrix client library
Expand Down
4 changes: 2 additions & 2 deletions spec/caridina/events/macros_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe "caridina_use_json_discriminator" do
end

it "raises with incomplet indirect discriminator" do
expect_raises(JSON::MappingError) do
expect_raises(JSON::SerializableError) do
ManyIndirectDiscriminator.from_json(%(
{
"othertype": {
Expand Down Expand Up @@ -400,7 +400,7 @@ describe "caridina_use_json_discriminator" do
end

it "raises if the discriminator value is unknown and not fallback is provided" do
expect_raises(JSON::MappingError) do
expect_raises(JSON::SerializableError) do
UniqueSimpleDiscriminator.from_json(%(
{
"type": "unknown"
Expand Down
2 changes: 1 addition & 1 deletion spec/caridina/spec_helper.cr
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require "../spec_helper"
require "../spec_helper"
2 changes: 1 addition & 1 deletion src/caridina.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "./caridina/connection"

module Caridina
VERSION = "0.8.0"
VERSION = "0.9.0"

Log = ::Log.for(self)
end
4 changes: 2 additions & 2 deletions src/caridina/events/macros.cr
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ macro caridina_use_json_discriminator(mapping, fallback = nil)

fields = {{mapping.keys.id}}
unless discriminators.size
raise ::JSON::MappingError.new("JSON is missing one of discriminator fields: #{fields}", to_s, nil, *location, nil)
raise ::JSON::SerializableError.new("JSON is missing one of discriminator fields: #{fields}", to_s, nil, *location, nil)
end

# Order the discriminators found by priority, higher priority first.
Expand Down Expand Up @@ -177,7 +177,7 @@ macro caridina_use_json_discriminator(mapping, fallback = nil)
{% if fallback %}
{{fallback.id}}.from_json(json)
{% else %}
raise ::JSON::MappingError.new("Unknown discriminators #{discriminators.inspect}", to_s, nil, *location, nil)
raise ::JSON::SerializableError.new("Unknown discriminators #{discriminators.inspect}", to_s, nil, *location, nil)
{% end %}
end
end

0 comments on commit a8dce4a

Please sign in to comment.