Skip to content

Commit

Permalink
test (unsupported) reinstantiation of a schema when the source schema…
Browse files Browse the repository at this point in the history
… has another schema than the metaschema
  • Loading branch information
notEthan committed Sep 11, 2021
1 parent 54d0ec4 commit b8c0bf9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/unsupported_test.rb
Expand Up @@ -63,6 +63,27 @@
)
end
end
describe 'the origin schema has schemas that do not describe a schema (items)' do
let(:schema_content) do
{
'items' => {'$ref' => '#/unknown'},
'unknown' => {},
}
end
let(:instance) do
[{}]
end
it "instantiates" do
assert_equal(
[JSI::Ptr["unknown"]],
subject[0].jsi_schemas.map(&:jsi_ptr)
)
unknown_schema = subject[0].jsi_schemas.to_a[0]
# check it's not an items schema like schema.items is
assert_equal(schema.jsi_schemas, unknown_schema.jsi_schemas)
refute_equal(schema.items.jsi_schemas, unknown_schema.jsi_schemas)
end
end
end
end
end

0 comments on commit b8c0bf9

Please sign in to comment.