From 4a683317f3b9ac67c0ec8a502abd38cc093961f3 Mon Sep 17 00:00:00 2001 From: Nicole Kennedy Date: Fri, 28 Jun 2019 14:03:45 -0400 Subject: [PATCH] note from_contents functionality --- bad_capability.json | 19 +++++++++++++++++++ test/unit/capability_json_test.rb | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100644 bad_capability.json create mode 100644 test/unit/capability_json_test.rb diff --git a/bad_capability.json b/bad_capability.json new file mode 100644 index 000000000..f52f9e7c1 --- /dev/null +++ b/bad_capability.json @@ -0,0 +1,19 @@ +{ + "name": "Inferno Capability Statement", + "status": "draft", + "date": "2019-07", + "kind": "capability", + "fhirVersion": "4.0.0", + "format": "json", + "rest": [ + { + "mode": "server", + "resource": "TestScript" + }, + { + "mode": "server", + "resource": "TestReport" + } + ], + "resourceType": "CapabilityStatement" +} \ No newline at end of file diff --git a/test/unit/capability_json_test.rb b/test/unit/capability_json_test.rb new file mode 100644 index 000000000..6455d39fd --- /dev/null +++ b/test/unit/capability_json_test.rb @@ -0,0 +1,10 @@ +require_relative '../test_helper' + +class CapJsonTest < Test::Unit::TestCase + def test_failing_capability_json + json = File.read('bad_capability.json') + cap = FHIR.from_contents(json) + puts "json: " + cap.to_json + assert cap.valid? + end +end \ No newline at end of file