Skip to content

Commit

Permalink
test Base#jsi_fingerprint by Schema#jsi_subschema_base_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
notEthan committed Jan 29, 2021
1 parent e09dafe commit dc52953
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/base_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -537,5 +537,16 @@
assert_equal('http://jsi/test/802e/4c01', act.schema_absolute_uri.to_s)
end
end
describe 'the jsi_schema_base_uri is different, but the schema_absolute_uri is unaffected' do
let(:schema) { JSI::JSONSchemaOrgDraft06 }
let(:instance) { {'$id' => 'http://jsi/test/a86e'} }
it 'is not equal' do
exp = schema.new_jsi(instance, jsi_schema_base_uri: 'http://jsi/test/802d/')
act = schema.new_jsi(instance, jsi_schema_base_uri: 'http://jsi/test/802e/')
assert_equal(exp, act)
assert_equal('http://jsi/test/a86e', exp.schema_absolute_uri.to_s)
assert_equal('http://jsi/test/a86e', act.schema_absolute_uri.to_s)
end
end
end
end

0 comments on commit dc52953

Please sign in to comment.